Expand description
T-snap-1 (2026-05-27): synthetic, read-only Document built from the alacritty scrollback + visible grid. The central vim grammar operates on this Document during the Normal / Visual sub-state of a terminal buffer; the renderer continues to paint the cell grid. A coord adapter (T-paint-1) translates document-space selection ranges back to cell coordinates at publish time so renderer paths stay buffer-kind-agnostic.
Design fragment: docs/dev/architecture/terminal-as- document.md. This module owns just the construction +
coord-translation primitives; the lifecycle (when the
snapshot is built / dropped) lives on TerminalNormalMode
(T-mode-1).
The snapshot is frozen for the duration of the Normal
sub-state. PTY output continues to feed alacritty in the
background; the SyntheticDoc does not auto-refresh. Re-entry
to Insert drops the snapshot. This matches vim’s :terminal
semantics and gives the user a stable target for motions /
marks / search.
Structs§
- Synthetic
Doc - Frozen read-only view of the terminal’s scrollback + visible
grid at the moment of an Insert → Normal transition. See
docs/dev/architecture/terminal-as-document.md§3.2 for the build rules and §3.3 for the coord-translation invariants. - Terminal
Store Handle - Cheap-clone handle to a
TerminalStore. Mirrors theBufferStoreHandlepattern — the host registers a wrapping handle in theServiceRegistryat boot; modes pull it viaModeContext::service::<TerminalStoreHandle>().
Traits§
- Terminal
Store - T-mode-1 (2026-05-27): service trait that
TerminalNormalModeuses to build / drop the SyntheticDoc on aTerminalBufferfrom its lifecycle hooks. The implementation lives on the host’sBufferRegistry; the mode pulls a handle to it viaModeContext::service::<TerminalStoreHandle>().