Skip to main content

Module display

Module display 

Source
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-mode and current-line-highlight-mode: their backing typed options don’t exist yet (the renderer has no :set list / :set cursorline plumbing). These land alongside the option in M.7.2.

Structs§

CurrentLineHighlightMode
current-line-highlight-mode — a display minor mode that overrides lattice_config::CursorLine to true (plus any further overrides) while active. Manual activation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when a mirrors name is declared.
LineNumbersMode
line-numbers-mode — a display minor mode that overrides lattice_config::Number to true (plus any further overrides) while active. Manual activation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when a mirrors name is declared.
ReadOnlyMode
read-only-mode — makes a buffer read-only in BOTH ways that matter: it contributes ReadOnly = 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.
RelativeLineNumbersMode
relative-line-numbers-mode — a display minor mode that overrides lattice_config::RelativeNumber to true (plus any further overrides) while active. Manual activation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when a mirrors name is declared.
WhitespaceShowMode
whitespace-show-mode — a display minor mode that overrides lattice_config::Whitespace to true (plus any further overrides) while active. Manual activation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when a mirrors name is declared.
WrapMode
wrap-mode — a display minor mode that overrides lattice_config::Wrap to true (plus any further overrides) while active. Manual activation; a user toggle for the option, kept in sync with it by the host’s option-mirror cascade when a mirrors name is declared.