Expand description
Cursor motion over a rope. Pure functions on (text, position), so every rule here
is testable without constructing a crate::Buffer.
Char-wise, not grapheme-wise, for now. ADR-0006 §1 puts grapheme awareness at this layer — one arrow press should cross a whole cluster, so an emoji with a skin-tone modifier takes one keypress and not three. That refinement belongs here when it lands and changes nothing above; the change representation stays char-indexed either way, which is exactly why the ADR separated the two.
Functions§
- column_
of - The column of
poswithin its line, in chars. - down
- left
- line_
end - Last char of the line
posis on, before its terminator — pressing End should land at the end of the visible text, not on the far side of the newline. - line_of
- The line
possits on. - line_
start - First char of the line
posis on. - right
- up
- Move one line up, aiming for
goalif the caller is tracking a sticky column.