Skip to main content

Module search_line_mode

Module search_line_mode 

Source
Expand description

MB.5a (rich minibuffer): search-line-mode.

The /·? search line is a buffer-backed, readline-grade editing surface (docs/dev/architecture/rich-minibuffer.md §6). Pressing / or ? creates / focuses the synthetic one-line *search-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 search-specific editing code.

search-line-mode is the major mode on that buffer. It owns the small delta a search 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. Because the layer is keyed under MajorMode(search-line-mode), the per-keystroke keymap_gated_ids filter scopes it to the *search-line* buffer only (mode-ownership; mode-architecture.md §5.3–5.4).

The buffer is insert-only: there is no Normal-mode entry, so <Esc> cancels cleanly.

Structs§

SearchLineMode
search-line-mode: the major mode of the *search-line* buffer.

Constants§

SEARCH_LINE_BUFFER_NAME
Synthetic name of the /·? search-line buffer. ephemeral keeps it out of :ls and the :bn/:bp cycle.
SEARCH_LINE_CANCEL
SEARCH_LINE_SUBMIT
Command names bound by search-line-mode’s keymap. Registered as CommandIds in crate::actions (each maps to an AppEffect that drives the Editor::do_search_line_* handler).
SEARCH_LINE_TOGGLE_EXPAND