Coherent buffer metadata for cursor-local operations.
Cursor columns use Minga's internal UTF-8 byte offsets. grapheme_column
records the corresponding grapheme offset explicitly so callers never need
to treat a byte offset as a String.slice/3 index.
Summary
Functions
Builds a coherent cursor-local snapshot from buffer-owned state.
Returns the internal byte-indexed cursor position.
Returns the text between a same-line byte position and the cursor.
Types
@type t() :: %Minga.Buffer.CursorContext{ byte_column: non_neg_integer(), file_path: String.t() | nil, filetype: atom(), grapheme_column: non_neg_integer(), line: non_neg_integer(), line_prefix: String.t(), line_text: String.t(), version: non_neg_integer() }
Functions
@spec new(Minga.Buffer.Document.t(), non_neg_integer(), String.t() | nil, atom()) :: t()
Builds a coherent cursor-local snapshot from buffer-owned state.
@spec position(t()) :: Minga.Buffer.Document.position()
Returns the internal byte-indexed cursor position.
@spec text_since(t(), Minga.Buffer.Document.position()) :: String.t() | nil
Returns the text between a same-line byte position and the cursor.