Expand description
Small App-helper state types – pure data, no renderer coupling.
Phase 5.2: extracted from lattice-ui-tui::app so the
eventual App migration carries fewer in-line type
definitions. Each struct here is a piece of state App holds
in a field (search line in progress, last search, unnamed
register, prev-pane snapshot). Renderer-agnostic by
construction.
Structs§
- Completion
State - Cmdline completion popup state: candidates and selection. Renderer-agnostic; the renderer reads this via &App.
- InFlight
Live Query - Spawned
on_query_changedfuture / stream paired with the query it was launched against. The drain compareslaunched_for_queryagainst the picker’s live query; if they differ, the user has kept typing and a newer fire is already in flight (or coming via debounce) – discard the stale result. - Last
Find - Capture of the most recent find/till for
;/,repeat. - Last
Search - Last completed search – consulted by
nandN. VM.3d-2: defined inlattice-grammarnow thatnis a motion; re-exported so no call site moved. VM.3d-2: the last completed//?/*/#search, which is allnandNneed to repeat it. Moved here from the host (which re-exports the name, so no call site moved) for the reasonLastFindwas:nis a motion now, and the state it repeats has to reach the grammar. - Last
Visual - Most-recently-completed visual selection. Used by
gvto reselect. - Live
Picker Query State - Live-picker query state. Installed when
open_pickerresolves a source whosespec().liveis true; survives until the picker is dismissed. - Macro
Recording - In-progress macro recording.
q<reg>starts;qagain stops and persists into the register table. - Minibuffer
Focus - MB.1 / MB.5a (rich minibuffer): the editing state suspended while a
minibuffer prompt (
:command line or/·?search line) ownsself.document. When a prompt opens, [Editor::focus_editing_buffer] swapsself.document/document_buffer_id/active_bufferto the synthetic*command-line*/*search-line*buffer and stashes the prior editing focus here without touching the pane tree (the active pane keeps rendering its own buffer). [Editor::restore_editing_buffer] pops it back on submit / cancel.Some(_)is the “a prompt is focused” flag; whether it’s the command line vs the search line is decided byEditor::search_line(command_line_active/search_line_active). Prompt-agnostic by design sogit-commit-line/repl-inputreuse it unchanged (design §6). - Missing
ArgPrompt - 5.5.G.23.cmdline: result of resolving a missing required first
arg on
:-submit. Built byEditor::try_resolve_missing_arg_promptand consumed bydo_command_line_submit. - Option
Cache - Hot-path option cache. Mirrors the typed-options registry’s
resolved values for the active buffer; reads on this struct
fire on every render tick, so the cache exists to skip a
HashMap lookup per option. Repopulated by
App::rebuild_option_cacheafter every:set. - Pending
Block Insert - In-flight blockwise-visual insert (
IorA). - Pending
Picker Accept - In-flight async picker accept. The future from
PickerSourceGenerator::accept_asyncis spawned on the LSP runtime (a plugin source’s accept is an async guest call bound to its actor task, so it must not block the actor thread); its resolved outcome lands here viarxand is applied bydrain_pending_picker_accept.targetis the open-target override consumed at accept time and re-applied when the outcome commits. MirrorsPendingPickerInit; thecanceltoken drops a superseded accept (a rapid second accept before this one drains). - Pending
Picker Init - In-flight async picker init. The future from
PickerSourceGenerator::initis spawned on the LSP runtime; its resolved batch lands here viarx. Thecanceltoken lets a subsequent:picker <source>drop the predecessor before it completes. - Pending
Transient Build - TR.2: in-flight async transient build. A guest-backed
menu’s builder answers a
TransientBuildFuturerather than a spec; it is spawned on the LSP runtime and its resolved spec lands here viarx, seated bydrain_pending_transient_buildon the async-landed wake. - Position
Entry - One entry in the unified position history (DESIGN.md §5.1.1).
- Prev
Pane State - Snapshot of the active pane’s state captured just before help
took it over. Used by
dismiss_popupto restore the user to the buffer + cursor + scroll they came from. The same struct serves both display modes (in-pane and popup-overlay). - Replace
Entry - One replace-mode entry – the byte that was at
atbefore the overwrite, so<BS>can restore it.original = Nonemeans the overwrite extended the line (the position was past EOL);<BS>deletes the inserted char rather than restoring a byte. - Ring
Entry - YR.2: a ring slot — the register plus how it got here.
- Search
Line - In-progress
/or?search state (MB.5a). The pattern text is NOT stored here — it lives in the focused*search-line*buffer (single source of truth, read viaEditor::search_pattern), the same way the:line reads*command-line*. This struct is the “search is active” marker + the metadata the buffer can’t carry: the direction (/vs?) and theorigincursor preserved so<Esc>restores it and incremental preview anchors its search. - Snippet
Candidate Meta - Sidecar metadata for snippet candidates in the active
insert-completion popup. Indexed by the candidate’s
CandidateData::Extension { payload }(u32 LE) – same shape as the LSP source’s sidecar. The host renders the snippet body on accept and starts anActiveSnippet; this struct carries the parsed body plus the display fields the popup row uses. - Substitute
Preview - Snapshot of an in-progress
:s/pat/repl/...preview. Refreshed on every cmdline keystroke while the input parses as a substitute; consumed by the renderer to overlay match ranges (and the typed replacement, when present) on the target buffer. - TagStack
Entry - One entry on the vim-style tag stack. Pushed by
gd(and the goto-* family) at the pre-jump cursor; popped by<C-t>to walk back. Distinct from the jump list because the user’s mental model for<C-t>is “undo the drill-down chain”, not “step through every cursor jump in chronological order”. - Unnamed
Register - The unnamed register’s payload. v1 uses a single global slot;
the full vim register zoo (
"a-z,"+,"*, etc.) lands later. - Yank
Ring - A bounded history of everything that has been yanked or deleted.
Enums§
Constants§
- LIVE_
PICKER_ DEBOUNCE - Debounce window before a live picker’s query change
fires
on_query_changed. Telescope uses ~150ms; chosen so that burst keystrokes coalesce into one source call without feeling laggy. Constant lives here (not inlattice-picker) because debounce is host policy – the picker primitive is renderer- and timer-agnostic.