pub enum BufferKind {
Document,
Help,
FileTree,
Oil,
Terminal,
Messages,
Multibuffer,
Dashboard,
}Expand description
Which kind of buffer the App’s input pipeline currently routes
to. The chord grammar, motions, and position history are shared;
kind only matters at a few discrete decision points: which cursor
a motion mutates, whether mutating actions are accepted (most
non-document kinds are read-only), and which buffer-local
bindings apply (Help binds <CR> to follow-link, FileTree binds
<CR> to follow-entry, etc.).
Variants§
Document
The user’s edit-target – one Document today.
Help
A :describe-* / :apropos / :keymap view. Read-only;
motions / yank work, edits don’t.
FileTree
Filesystem hierarchy view (DESIGN.md §5.9 buffer-as-content).
Rope-backed with one rendered line per visible entry; <CR>
on a directory toggles expansion, on a file opens it as a
new Document buffer.
Oil
Flat editable directory listing (oil.nvim-style).
Writable — operators and motions run against the oil rope;
:w diffs the rope against its snapshot and executes
renames/deletes/creates on disk.
Terminal
PTY-backed terminal buffer (issue #40, T1 / Terminal-mode).
Owns a child process via lattice-terminal::PtyHandle; the
reader task publishes TerminalSnapshots the renderer paints
as a cell grid. Two sub-states (T2): Normal-in-terminal (vim
motions over the scrollback) and Terminal-Insert (keystrokes
encoded → PTY stdin). NOT editable via the standard rope
operator path — is_read_only() returns true so the
operator dispatcher leaves it alone.
Messages
*messages* audit-log buffer (DESIGN.md §5.10.6 / emacs’
*Messages* analogue). Rope-backed like Document
internally — its mode (messages-mode) contributes
ReadOnly = true so the dispatcher gates keystrokes, and
NoFile = true so :q skips its dirty check. The kind is
distinct so introspection (:ls, modeline) doesn’t
conflate the transcript with user-edited documents.
Multibuffer
Composed view over N source buffers,
owned by lattice_multibuffer::MultibufferDocumentHandle.
Read-only in M.1; edit propagation lands in M.3.
MultibufferMode (the major mode registered against this
kind in M.2.b.2) owns the typed handle as its per-buffer
context Guard, plus the ]e / [e / ]E / [E motion
keymap. See docs/dev/architecture/multibuffer-views.md
§3.6.
Slice: M.2.b.1 (2026-05-31).
Dashboard
*dashboard* launch page (DB.2, docs/dev/architecture/dashboard.md).
Rope-backed like Document; its major mode (dashboard-mode)
contributes ReadOnly = true + NoFile = true so the dispatcher
gates keystrokes and :q skips its dirty check. Behaviourally a
read-only, link-bearing, help-style buffer — it is grouped with
BufferKind::Help in the <CR>-follow / Esc-dismiss gates
(input.rs, dispatch.rs) and reuses the help link machinery, while
staying a distinct kind so :ls / introspection don’t conflate it
with the transcript or user documents.
Implementations§
Source§impl BufferKind
impl BufferKind
Sourcepub fn is_read_only(self) -> bool
pub fn is_read_only(self) -> bool
Whether mutating operators (delete, change, paste, insert)
are accepted on this kind. Only BufferKind::Document and
BufferKind::Oil are writable; Terminal mutates via its
own PTY-stdin path, not through rope operators. Messages
is read-only at the dispatcher level (messages-mode
contributes ReadOnly); subsystem appends bypass via the
edit-batch path.
Trait Implementations§
Source§impl Clone for BufferKind
impl Clone for BufferKind
Source§fn clone(&self) -> BufferKind
fn clone(&self) -> BufferKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BufferKind
Source§impl Debug for BufferKind
impl Debug for BufferKind
Source§impl Default for BufferKind
impl Default for BufferKind
Source§fn default() -> BufferKind
fn default() -> BufferKind
impl Eq for BufferKind
Source§impl Hash for BufferKind
impl Hash for BufferKind
Source§impl PartialEq for BufferKind
impl PartialEq for BufferKind
impl StructuralPartialEq for BufferKind
Auto Trait Implementations§
impl Freeze for BufferKind
impl RefUnwindSafe for BufferKind
impl Send for BufferKind
impl Sync for BufferKind
impl Unpin for BufferKind
impl UnsafeUnpin for BufferKind
impl UnwindSafe for BufferKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.