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<RefCell<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
The application is single-threaded. RefCell is used instead of a
Mutex — there is no runtime locking cost and the borrow checker
enforces the aliasing rules at development time. Syntax workers and
LSP handlers take snapshots (owned Vec<String> / String) rather
than long-lived borrows, so they never hold a RefCell guard across
an await point.
Structs§
- Content
- Per-document state shared across all
crate::Bufferviews of the same file. Wrap inArc<RefCell<Content>>and pass tocrate::Buffer::new_viewto create an additional window onto the same content.