Skip to main content

wrap_with_gutter

Function wrap_with_gutter 

Source
pub fn wrap_with_gutter(
    content: Line,
    total_width: u16,
    head: &Line,
    tail: &Line,
) -> Frame
Expand description

Soft-wrap content to fit inside total_width columns and prepend a gutter: the first visual row gets head, continuation rows get tail. head and tail must have equal display width (debug-asserted by Frame::prefix); that width is reserved for the gutter and the remainder is used for content.

Each wrapped row has its background extended to the inner width before the gutter is prepended, so row-fill (e.g. diff added/removed stripes) spans the full content column without bleeding into the gutter column.