Skip to main content

PendingState

Enum PendingState 

Source
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

Fields

§count: usize
§

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).

Fields

§count: usize
§forward: bool
§till: bool
§

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).

Fields

§count: usize
§

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).

Fields

§count: usize
§

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.

Fields

§count1: usize
§inner_count: usize
§

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.

Fields

§total_count: usize
§forward: bool
§till: bool
§

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.

Fields

§total_count: usize
§inner: bool
§

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.

Fields

§total_count: usize
§

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 }.

Fields

§count: usize

Trait Implementations§

Source§

impl Clone for PendingState

Source§

fn clone(&self) -> PendingState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PendingState

Source§

impl Debug for PendingState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PendingState

Source§

impl PartialEq for PendingState

Source§

fn eq(&self, other: &PendingState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PendingState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more