Skip to main content

Module synthetic

Module synthetic 

Source
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§

SyntheticDoc
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.
TerminalStoreHandle
Cheap-clone handle to a TerminalStore. Mirrors the BufferStoreHandle pattern — the host registers a wrapping handle in the ServiceRegistry at boot; modes pull it via ModeContext::service::<TerminalStoreHandle>().

Traits§

TerminalStore
T-mode-1 (2026-05-27): service trait that TerminalNormalMode uses to build / drop the SyntheticDoc on a TerminalBuffer from its lifecycle hooks. The implementation lives on the host’s BufferRegistry; the mode pulls a handle to it via ModeContext::service::<TerminalStoreHandle>().