Expand description
Per-document text content. Arc-shareable across multiple crate::Buffer
views.
Content owns everything that belongs to the document itself:
- The
linesrope (text content). - The
dirty_genrender-cache generation counter. - Manual folds (
folds).
crate::Buffer is the per-window wrapper. It holds an
Arc<Mutex<Content>> plus the per-window cursor. Two Buffer
instances that share one Content see the same text and folds, but
each moves its cursor independently.
§Concurrency
Held inside Arc<Mutex<Content>> so multiple Buffer views can share
one document safely. Mutex (not RefCell) because the engine’s
Cursor, Query, BufferEdit, and Search traits require Send,
and RefCell is !Send. Lock contention is near-zero in the
single-threaded app loop; the Mutex is essentially a free Send
adapter.
Structs§
- Content
- Per-document state shared across all
crate::Bufferviews of the same file. Wrap inArc<Mutex<Content>>and pass tocrate::Buffer::new_viewto create an additional window onto the same content.