Expand description
Soft-wrap helpers shared between the renderer, viewport scroll, and the buffer’s vertical motion code.
Enums§
- Wrap
- Soft-wrap mode controlling how doc rows wider than the text area
turn into multiple visual rows. Default is
Wrap::None— every doc row is exactly one screen row andtop_colclips the left side, mirroring vim’sset nowrapdefault for sqeel today.
Functions§
- segment_
for_ col - Returns the index into
segmentswhose[start, end)coverscol. The past-end cursor (col == last segment's end) maps to the last segment, matching vim’s “EOL on the visual row that holds the line’s last char” behaviour. - wrap_
segments - Split
lineinto char-index segments[start, end)such that each segment’s display width fits withinwidthcells.Wrap::Wordrewinds to the last whitespace inside the candidate segment when a break would otherwise split a word; falls through to a char break for runs longer thanwidth.Wrap::Noneis not expected here — callers branch before calling — but is handled for completeness as a single segment covering the full line.