Skip to main content

wrap_line

Function wrap_line 

Source
fn wrap_line(line: &Line, max_width: u16) -> Vec<WrappedLine>
Expand description

Greedy word-wrap over a Line’s spans.

Breaks on ASCII space (' '): the space is consumed (not placed) at the break point, and overlong words are force-broken at the column boundary. Leading whitespace on soft-wrapped continuation lines is preserved.

Note: only \n and ASCII space are treated specially. Tabs, NBSP, and other whitespace are treated as printable 1-wide characters. Callers should expand tabs before calling if that matters.