Moves the document cursor while preserving valid editor caret positions.
Summary
Functions
Returns whether a byte column is an exact editor caret boundary in a line.
Clamps a byte column to the nearest preceding editor caret boundary in a line.
Moves the cursor one move in the requested direction.
Returns the character immediately after a caret.
Places the cursor at the nearest valid caret position for the requested editor position.
Splits the character immediately before a caret from the preceding text.
Types
Functions
@spec caret_boundary?(String.t(), non_neg_integer()) :: boolean()
Returns whether a byte column is an exact editor caret boundary in a line.
@spec caret_column(String.t(), non_neg_integer()) :: non_neg_integer()
Clamps a byte column to the nearest preceding editor caret boundary in a line.
@spec move(Minga.Buffer.Document.t(), direction()) :: Minga.Buffer.Document.t()
Moves the cursor one move in the requested direction.
Returns the character immediately after a caret.
@spec place(Minga.Buffer.Document.t(), Minga.Buffer.Document.position()) :: Minga.Buffer.Document.t()
Places the cursor at the nearest valid caret position for the requested editor position.
Splits the character immediately before a caret from the preceding text.