Skip to main content

Module command_line_mode

Module command_line_mode 

Source
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§

CommandLineMode
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 as CommandIds in crate::actions (each maps to an AppEffect that drives the rewired Editor::do_command_line_* handler).
CMDLINE_TOGGLE_EXPAND
COMMAND_LINE_BUFFER_NAME
Synthetic name of the : command-line buffer. :ls / :b can reach it; :bn / :bp skip it (listed = false).