Expand description
MB.1 (rich minibuffer, tier 1): command-line-mode.
The : command line is a buffer-backed, readline-grade editing
surface (docs/dev/architecture/rich-minibuffer.md §2). Pressing
: creates / focuses the synthetic one-line *command-line*
Document through the mode-owned creation seam
(lattice_mode::ModeActivator::ensure_named_document) and
focus-swaps it in as the editing buffer
([crate::dispatch::Editor::focus_editing_buffer]). Keys then flow
through the universal Insert dispatcher, so the readline chords
(<C-a>/<C-e>/<C-b>/<C-f>/<C-w>/<C-u>, cursor keys,
<Del>) edit it directly — no cmdline-specific editing code.
command-line-mode is the major mode on that buffer. It owns the
small delta a command line adds over a plain Insert buffer, via an
Insert-mode keymap layer (Mode::keymap, resolved through
keymap_mode_contributions): <CR> submit, <Esc> / <C-c>
cancel, <C-p> / <C-n> / <Up> / <Down> history walk, <Tab> /
<S-Tab> completion, <C-h> describe-under-cursor. Because the
layer is keyed under MajorMode(command-line-mode), the per-keystroke
keymap_gated_ids filter scopes it to the *command-line* buffer
only (mode-ownership; mode-architecture.md §5.3–5.4).
The handler bodies stay as the (rewired) Editor::do_command_line_*
methods reached through the AppEffect host boundary — the same
pattern action:enter-command-line uses. The buffer is insert-only:
there is no Normal-mode entry, so <Esc> cancels cleanly.
Structs§
- Command
Line Mode command-line-mode: the major mode of the*command-line*buffer.
Constants§
- CMDLINE_
CANCEL - CMDLINE_
COMPLETE - CMDLINE_
COMPLETE_ PREV - CMDLINE_
DESCRIBE - CMDLINE_
HISTORY_ NEXT - CMDLINE_
HISTORY_ PREV - CMDLINE_
SUBMIT - Command names bound by
command-line-mode’s keymap. Registered asCommandIds incrate::actions(each maps to anAppEffectthat drives the rewiredEditor::do_command_line_*handler). - CMDLINE_
TOGGLE_ EXPAND - COMMAND_
LINE_ BUFFER_ NAME - Synthetic name of the
:command-line buffer.:ls/:bcan reach it;:bn/:bpskip it (listed = false).