Skip to main content

Module buffer

Module buffer 

Source
Expand description

Buffer: a thin, edit-aware wrapper around ropey::Rope.

All edits flow through apply_edit, which:

  • validates the range against current bounds
  • mutates the rope in O(log n)
  • returns enough information for the caller to record an inverse for undo and an AppliedEdit for change events

This crate does not own the actor that serializes edits; that lives in the dispatcher (later phase). Callers are expected to hold the buffer behind whatever single-writer discipline they prefer.

Structs§

AppliedEdit
What an apply_edit produced. The caller uses this to log change events and to construct an inverse Edit for the undo stack.
Buffer
A rope-backed text buffer: the raw text storage under every Document.

Functions§

transform_position
Transform a position across an edit (§4.1 of owner-write-caret.md).