Visual-line motions for soft word-wrapping.
When word-wrap is enabled, a single logical line may span multiple screen rows. These functions move the cursor by visual rows rather than logical lines, keeping the cursor at the same visual column (or as close as possible) across wrapped rows.
These replace j/k when wrap is on. The original j/k behavior
(logical line movement) is available via gj/gk.
Summary
Functions
Move down by one visual row within a wrapped buffer.
Move to the end of the current visual row.
Move to the start of the current visual row.
Move up by one visual row within a wrapped buffer.
Types
@type position() :: Minga.Buffer.Document.position()
Functions
@spec visual_down(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
Move down by one visual row within a wrapped buffer.
If the cursor is on a visual row that has more rows below it (within the same logical line), moves to the next visual row. Otherwise moves to the first visual row of the next logical line.
@spec visual_line_end(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
Move to the end of the current visual row.
When the cursor is on a visual row within a wrapped line, moves to the last column of that visual row.
@spec visual_line_start(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
Move to the start of the current visual row.
When the cursor is on a continuation row of a wrapped line, moves to the first column of that visual row (not the logical line start).
@spec visual_up(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
Move up by one visual row within a wrapped buffer.
If the cursor is on a visual row that has rows above it (within the same logical line), moves to the previous visual row. Otherwise moves to the last visual row of the previous logical line.