pub enum PendingState {
Show 14 variants
Replace {
count: usize,
},
Find {
count: usize,
forward: bool,
till: bool,
},
AfterG {
count: usize,
},
AfterZ {
count: usize,
},
AfterOp {
op: OperatorKind,
count1: usize,
inner_count: usize,
},
OpFind {
op: OperatorKind,
total_count: usize,
forward: bool,
till: bool,
},
OpTextObj {
op: OperatorKind,
total_count: usize,
inner: bool,
},
OpG {
op: OperatorKind,
total_count: usize,
},
SelectRegister,
SetMark,
GotoMarkLine,
GotoMarkChar,
RecordMacroTarget,
PlayMacroTarget {
count: usize,
},
}Expand description
Pending-state machine for second-key chords. The umbrella stores
Option<PendingState>; when Some, it routes keys through step
instead of the keymap trie.
Variants§
Replace
Find
f<x> / F<x> / t<x> / T<x> — find single char on current line.
forward = direction (true for f/t, false for F/T).
till = stop one char before target (true for t/T, false for f/F).
AfterG
g<x> — bare g-prefix chord in Normal / Visual mode. The app sets this
after intercepting g; step routes the next Key::Char(ch) to
EngineCmd::AfterGChord { ch, count }. Key::Esc cancels; any
non-char key also cancels (mirrors the Find arm).
AfterZ
z<x> — bare z-prefix chord in Normal / Visual mode. The app sets this
after intercepting z; step routes the next Key::Char(ch) to
EngineCmd::AfterZChord { ch, count }. Key::Esc cancels; any
non-char key also cancels (mirrors the AfterG arm).
AfterOp
d<x> / y<x> / c<x> / ><x> / <<x> — bare op-pending entered
from Normal mode after the operator key. count1 is the count pressed
before the operator; inner_count accumulates digits pressed after the
operator (e.g. d3w → count1=1, inner_count=3, total=3). The reducer
is authoritative for both counts; total = count1.max(1) * inner_count.max(1) is passed to the engine on completion.
Vim quirk: a bare 0 when inner_count == 0 is the line-start motion
(LineStart), not a digit. Any other digit, or 0 when inner_count > 0, accumulates.
OpFind
df<x> / dF<x> / dt<x> / dT<x> and same for y/c/>/<. Reached
from AfterOp when the next key after the operator is f/F/t/T.
total_count = count1.max(1) * inner_count.max(1) already folded at
transition time; neither component is independently meaningful after
this point.
The next char is the find target. Key::Esc or any non-char cancels
(vim’s f<Esc> cancel semantics apply here too).
cf<x> stays as Change + Find — the cw→ce quirk in apply_op_with_motion
only rewrites Motion::WordFwd/BigWordFwd, not Motion::Find.
OpTextObj
di<x> / da<x> etc. — reached from AfterOp when next key after
operator is i or a. total_count = count1 * inner_count already
folded; engine ignores it for text-object motions but it’s passed
through for future-proofing / consistency with OpFind shape.
OpG
dgg / dge / dgE / dgj / dgk etc. — reached from AfterOp
when next key after operator is g. For case-ops (gu/gU/g~) the
doubled form (gUgU = gUU linewise) is dispatched here too — engine
detects via op-matching second char.
SelectRegister
"<reg> — register-prefix chord in Normal mode. The next char names
a register that the next y/d/c/p operation will use. Engine validates
the char; invalid chars silently no-op.
SetMark
m<x> — set mark x at current cursor position. Any char cancels on
Esc or non-char key; only alphanumeric and special marks are accepted by
the engine, invalid chars silently no-op (engine validates).
GotoMarkLine
'<x> — go to mark x, linewise (row only, col = first non-blank).
Esc or non-char key cancels; engine validates the char and no-ops on
unset or invalid marks.
GotoMarkChar
`<x> — go to mark x, charwise (row + col). Esc or non-char key
cancels; engine validates the char and no-ops on unset or invalid marks.
RecordMacroTarget
q pressed in Normal mode while NOT already recording — waits for the
register char. Esc or non-char key cancels (no recording started). Any
alphabetic or digit char commits StartMacroRecord { reg: ch }. The
stop-on-bare-q path is handled in AppAction::QChord BEFORE this
pending state is entered.
PlayMacroTarget
@ pressed in Normal mode — waits for the register char. Esc or
non-char key cancels. '@' commits PlayMacro { reg: '@', count } for
@@ repeat-last semantics (host resolves actual register). ':'
commits PlayMacro { reg: ':', count } for @: last-ex-repeat
(host handles app-side storage — Phase 5d). Any other alphabetic or
digit char commits PlayMacro { reg: ch, count }.
Trait Implementations§
Source§impl Clone for PendingState
impl Clone for PendingState
Source§fn clone(&self) -> PendingState
fn clone(&self) -> PendingState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PendingState
Source§impl Debug for PendingState
impl Debug for PendingState
impl Eq for PendingState
Source§impl PartialEq for PendingState
impl PartialEq for PendingState
Source§fn eq(&self, other: &PendingState) -> bool
fn eq(&self, other: &PendingState) -> bool
self and other values to be equal, and is used by ==.