Expand description
N.1.1 (2026-06-10): narrow mode — a focused, editable one-excerpt
multibuffer view of a region. Unlike search, narrow is a
first-class built-in (no cargo feature gate): no async scan, no
service, no per-view state beyond the excerpt.
N.1.1 (2026-06-10): narrow mode — a focused, editable
one-excerpt multibuffer view of a region of a source buffer.
Design: docs/dev/architecture/narrow-mode.md. Slice plan:
docs/dev/operations/slice-plans/narrow-mode.md (N.1.1).
Narrow is a one-excerpt multibuffer + a marker minor mode.
There is no BufferKind::Narrow — the view is a regular
BufferKind::Multibuffer and reuses every M-series primitive
(M.3 edit propagation, M.4 live source updates, K.4.7 per-excerpt
syntax). Edits in the narrow view propagate to the source buffer;
:widen closes the view, leaving the source (with its edits)
open.
Unlike providers::search, narrow is not feature-gated — it’s
a first-class built-in primitive — and it carries no async scan,
no service, and no per-view state beyond the excerpt itself.
Entry is the :narrow [{range}] ex-command (and, from N.1.3, the
zn operator). The ex-command emits AppEffect::NarrowTrigger;
the host arm resolves the range, fetches the active buffer’s
handle, and calls [create_narrow_view].
Structs§
- Narrow
Mode narrow-mode— the provider-minor activated on a narrow view. In N.1.1 it is a pure identity marker: a multibuffer with this minor active IS a narrow view (distinguished from search / diff multibuffers), which the host’s:widenguard and N.1.5’s stacking logic read.- Narrow
Mode Guard - RAII guard for
NarrowMode. Unit in N.1.1 (no subscriptions / action handlers yet); becomes aVecofActionHandlerRegistrationwhen theq/:wsurface lands.
Functions§
- create_
narrow_ view - Allocate a one-excerpt multibuffer view over
[start_line, end_line](inclusive, 0-based) ofsource_idand activateNarrowModeon it. Returns the new view’sBufferId. - register_
narrow_ ex_ commands - Boot helper — register the
:narrow+:widenex-commands. - register_
narrow_ mode - Boot helper — register the narrow provider-minor mode. Called
from
lattice-host::editor_bootalongside the other multibuffer mode registrations. - register_
narrow_ operator - N.1.3 (2026-06-10): register the
znnarrow operator into the grammar’sCommandRegistryand return itsOperatorId.