Skip to main content

Module keymap_normal

Module keymap_normal 

Source
Expand description

Crossterm-coupled test harness for the renderer-neutral lattice_host::keymap_normal catalog. Slice 5.4 / slice 3 moved the production code to lattice-host; the tests stay here because their ev() helper builds KeyChord values via crate::chord::from_event(&KeyEvent { ... }), and the crossterm adapter only exists in this crate.

pub use re-exports every public item from the host so call sites that referenced lattice_ui_tui::keymap_normal::* before the move keep resolving without source changes.

Functions§

attach_count
Slice 8.g.iv: attach the input-side count accumulator to a resolved Action::Invoke. Pure function; non-Invoke actions pass through unchanged.
binding_layer_mode
Resolve the next key of a multi-chord Normal-mode sequence via the registry. The caller supplies the prefix chord sequence already absorbed; this helper appends the normalised current chord and looks the resulting path up in the trie. Bound -> the bound action; everything else (Partial / Unbound) -> Action::None to drop the pending state, matching every legacy resolve_after_*’s catchall.
expand_grammar_rows
Derive the rows a grammar binding implies but nobody wrote: a motion’s Visual / Select / operator-pending peers, and a text object’s.
lookup_normal
Look up a single-key event in the Normal-mode catalog. Returns Some(action) when the chord is bound; None to signal the caller (input::translate_normal) to fall back to its legacy match arm for the not-yet-migrated bindings.
lookup_normal_with_prefix
operator_prefix
Map an operator id to its primary chord prefix in the Normal-mode trie. Used by the Pending::AfterOperator and Pending::AfterTextObject resolvers to compute the lookup path.
register_normal_bindings
Register the slice 8.g.i Normal-mode catalog into the supplied handle’s Builtin layer. The legacy input::translate_normal keeps its match arm for the bindings not yet in this catalog.
register_operator_bindings
Register the slice 8.g.iii operator-pending paths for one operator under op_prefix. Same shape across every operator: motion targets, the doubled-operator current-line shorthand, i_ / a_ text-object pendings + their resolutions, and the f / F / t / T find-char pendings (resolution stays in legacy resolve_after_find_char until 8.g.v).
register_operator_bindings_in
CM.2: register_operator_bindings with the layer chosen by the caller.