Skip to main content

Module buffer

Module buffer 

Source
Expand description

Buffer — a rope-backed document and the only thing that applies transactions.

This is the chokepoint ARCHITECTURE.md §8 asks for. Nothing above this type mutates text: callers hand over an EditTransaction and the buffer validates it, computes the inverse while the pre-image is still live, applies it, bumps the version, carries the selection, and records the undo step. A transaction authored against a version the buffer has moved past is rejected here rather than silently corrupting the document — which is what makes an asynchronous agent safe to accept edits from.

Structs§

Buffer
A text buffer: the document, where the cursor is, and how it got here.

Enums§

EditError
Why a transaction was refused.
LineEnding
How a file’s lines were terminated on disk.

Type Aliases§

EditResult