Expand description
Preview isolation (PI series).
In-pane picker preview renders buffer B as an isolated read-only
projection in a pane — never mutating the committed buffer A, the
global active-buffer hot state, or A’s resolved options / mode stack.
See docs/dev/architecture/preview-isolation.md for the contract and
docs/dev/operations/slice-plans/preview-isolation.md (PI series) for
sequencing.
This module owns the two host-side pieces the design calls out:
PreviewOverride— the ephemeral per-pane sidecar value (Editor::preview_overrides, keyed byPaneId). It records the displayed buffer + the preview viewport (cursor / scroll) while a pane’s committedbuffer_idstays put. Baked into the published pane-tree leaves at render-publish time (build_render_state) so the renderers show the displayed buffer while:ls/ modeline / dispatch keep reading the committed one.PreviewMode— thepreview-modeminor (§10.2 resolution: option (a)) that ownsReadOnly = trueand, by its presence on B’s own mode stack, the ephemeral “this buffer is being previewed” marker. It deliberately does not touchCursorLine, so a preview keeps the buffer’s cursorline (the target line stays highlighted — e.g. an LSP reference preview).
Structs§
- Preview
Mode - PI.2 (§10.2 option (a)): the
preview-modeminor. ContributesReadOnly = trueto the buffer it is active on; its presence on a buffer’s mode stack is the ephemeral “previewing” marker (introspect via:describe-mode). Activated only on the previewed buffer B’s own stack (never A’s), so B’sresolved_optionsreflect read-only while the committed buffer is untouched. - Preview
Override - PI.1: a pane’s ephemeral preview projection. Stored host-side in
Editor::preview_overrides(keyed byPaneId) so the liveEditor::pane_treestays committed + geometry-only; the override is baked into the published pane-tree leaves each frame.