Expand description
Display minor modes – thin user-toggleable wrappers around the typed display options that already shipped (DESIGN.md §5.12 + mode-architecture.md §4.2.2 / M.7).
Each mode contributes its corresponding typed option’s
“on” value via Mode::options(). Activating the mode flips
the option in the buffer’s resolved state via the
mode-contribution layer; deactivating removes the
contribution and the resolver falls back to the typed-option
layer (TOML / :set / default).
§Two surfaces, one underlying state
:set number=true and :line-numbers-mode both flip the
resolved value of Number for the active buffer. They sit at
different layers of the resolver:
- Typed-option layer (
:set): the persistent global / per-project value; user-typed config. - Mode-contribution layer (
:line-numbers-mode): the per-buffer mode-driven override.
Layer priority is mode-contribution > typed-option, so when
the mode is active it wins regardless of :set state. The
M.7.1 follow-up adds a cascade so :set number=false also
deactivates line-numbers-mode, giving full bidirectional
convergence; for v1 the mode is a one-way ratchet –
activating it forces the on-value, deactivating it removes
the contribution and the typed-option layer takes over.
§What’s NOT here
whitespace-show-modeandcurrent-line-highlight-mode: their backing typed options don’t exist yet (the renderer has no:set list/:set cursorlineplumbing). These land alongside the option in M.7.2.
Structs§
- Current
Line Highlight Mode current-line-highlight-mode— a display minor mode that overrideslattice_config::CursorLinetotrue(plus any further overrides) while active.Manualactivation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when amirrorsname is declared.- Line
Numbers Mode line-numbers-mode— a display minor mode that overrideslattice_config::Numbertotrue(plus any further overrides) while active.Manualactivation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when amirrorsname is declared.- Read
Only Mode read-only-mode— makes a buffer read-only in BOTH ways that matter: it contributesReadOnly = true(which gates insert-mode typing) and declares an invocation runner that refuses operators (x,dd,cw,p), which never pass through the option’s gate.- Relative
Line Numbers Mode relative-line-numbers-mode— a display minor mode that overrideslattice_config::RelativeNumbertotrue(plus any further overrides) while active.Manualactivation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when amirrorsname is declared.- Whitespace
Show Mode whitespace-show-mode— a display minor mode that overrideslattice_config::Whitespacetotrue(plus any further overrides) while active.Manualactivation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when amirrorsname is declared.- Wrap
Mode wrap-mode— a display minor mode that overrideslattice_config::Wraptotrue(plus any further overrides) while active.Manualactivation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when amirrorsname is declared.