Skip to main content

attach_count

Function attach_count 

Source
pub fn attach_count(action: Action, pending_count: u32, op_count: u32) -> Action
Expand description

Slice 8.g.iv: attach the input-side count accumulator to a resolved Action::Invoke. Pure function; non-Invoke actions pass through unchanged.

Vim semantics: <op-count><op><motion-count><motion> yields a final count of op_count * motion_count. Either alone replaces the default count of 1. The motion side falls back to inv.count (any default the binding registered with at boot, e.g. <PageDown>’s Count(10)) when the user hasn’t typed a digit prefix.

Architecture doc §7.1: “Once a non-digit chord arrives, lookup runs with the accumulated count attached to the resulting CommandInvocation’s count field. Dispatch unchanged; execute(invocation_with_count) works today.” Before this slice the multiplication lived in App’s dispatcher (run_document_invocation / run_read_only_motion); now it rides with the action out of translate_normal. App still resets pending_count / op_count at end-of-dispatch.