Persistent native Rope text storage with revisioned atomic edits.
This is a model primitive. It does not represent a file, editor, language, gutter, or workspace. Consumers own those policies and may later attach one or more renderer primitives to the same buffer.
Summary
Functions
Creates a native text buffer with one primary selection.
Redoes one native transaction and creates a new monotonic revision.
Returns the current text, revision, selections, and history availability.
Atomically applies a transaction based on the current revision.
Undoes one native transaction and creates a new monotonic revision.
Types
@type result(value) :: {:ok, value} | {:error, term()}
@opaque t()
Functions
Creates a native text buffer with one primary selection.
@spec redo(t(), non_neg_integer()) :: result(GPUI.Text.Snapshot.t())
Redoes one native transaction and creates a new monotonic revision.
@spec snapshot(t()) :: result(GPUI.Text.Snapshot.t())
Returns the current text, revision, selections, and history availability.
@spec transact(t(), GPUI.Text.Transaction.t()) :: result(map())
Atomically applies a transaction based on the current revision.
@spec undo(t(), non_neg_integer()) :: result(GPUI.Text.Snapshot.t())
Undoes one native transaction and creates a new monotonic revision.