Skip to main content

move_cursor

Function move_cursor 

Source
pub fn move_cursor(
    buf: &TextBuffer,
    from: TextPos,
    motion: CursorMotion,
) -> TextPos
Expand description

Resolve a CursorMotion from from against the buffer contents. Line motions step logical (\n-delimited) lines with byte-column preservation. Public so the keystroke router shares one motion implementation with the request mutator.