pub struct WrapOpts {
pub preserve_spaces: bool,
pub hard_break_long_tokens: bool,
pub trim_end: bool,
pub continuation_prefix: Option<Vec<Span>>,
}Expand description
Options controlling span-aware word wrapping.
These settings are intentionally generic and suitable for help viewers, log viewers, search UIs, and other terminal applications.
Fields§
§preserve_spaces: boolPreserve whitespace runs exactly as provided.
When false, whitespace runs are normalized to a single ASCII space, and leading whitespace at the beginning of a visual line is dropped.
hard_break_long_tokens: boolIf a single non-whitespace token exceeds the available width, hard-break it by grapheme cluster.
trim_end: boolTrim trailing whitespace at the end of each visual line.
continuation_prefix: Option<Vec<Span>>Optional prefix to apply to continuation lines produced by wrapping.
A continuation line is a visual line created because a token would
exceed the available width and the line is wrapped. Explicit newline
characters do not produce continuation lines.
The prefix is only applied if its measured cell width is strictly less
than width.