Expand description
The unified dispatcher (DESIGN.md §5.2.1).
execute is the single entry point through which every command flows:
built-in operators / motions / text-objects, ex-commands parsed from :,
plugin contributions, and palette selections. Vim’s grammar UX is
preserved exactly via the keystroke parser (which assembles a
CommandInvocation and calls execute); the simplification is that there
is just one dispatcher below the parser.
Phase 1 implements operator-with-motion-target (the most common path),
motion-alone, text-object-alone, and explicit grammar Range resolution.
ExCommand and Action paths are wired – the latter via slice 8.i.0
(see docs/dev/notes/8i-approach.md); registry entries grow during slices
8.i.1-3 as the legacy Action bridge in lattice-ui-tui retires.
Functions§
- execute
- Execute a
CommandInvocationagainstdocument, usingregistryto resolve motions / text-objects / operators. - execute_
motion_ only - Resolve a motion-only invocation against a bare [
Buffer] + cursor, without a [Document] / undo stack / selections. - execute_
motion_ only_ reporting - VM.3d-2:
execute_motion_only, also reporting the motion’s notice. - execute_
with_ env - N.1.4a / N.1.6 (2026-06-10):
executeplus the per-dispatchGrammarEnv— the tree-sitterscope_resolver(af/ac) and thecomment_syntax(aC/iC). The host builds the env (N.1.4b / N.1.6) and threads it down to theTextObjectContext; the classic objects (iw,ap,i{) ignore it. - notice_
text - VM.3d-2: what a motion’s notice says. One wording for both peers — the
document path (an
Effect::Echobeside the motion) and the read-only one (the host echoes it itself), which would otherwise drift.