Minga.Mode.OperatorPendingState (Minga v0.1.0)

Copy Markdown View Source

FSM state for Operator-Pending mode.

Carries the pending operator (delete/change/yank), the count prefix accumulated before the operator key, and text-object/g-prefix tracking.

Summary

Types

The pending operator.

t()

Text object modifier (inner vs around).

Functions

Creates a new operator-pending state.

Converts operator-pending state back to the base Mode.State, discarding all operator-specific fields.

Total repeat count: op_count (from before the operator key) × motion count.

Types

operator()

@type operator() ::
  :comment | :delete | :change | :yank | :indent | :dedent | :reindent

The pending operator.

t()

@type t() :: %Minga.Mode.OperatorPendingState{
  count: non_neg_integer() | nil,
  leader_keys: [String.t()],
  leader_node: Minga.Keymap.Bindings.node_t() | nil,
  op_count: pos_integer(),
  operator: operator(),
  pending_g: boolean(),
  text_object_modifier: text_object_modifier() | nil
}

text_object_modifier()

@type text_object_modifier() :: :inner | :around

Text object modifier (inner vs around).

Functions

new(operator, op_count \\ 1)

@spec new(operator(), pos_integer()) :: t()

Creates a new operator-pending state.

to_base_state(operator_pending_state)

@spec to_base_state(t()) :: Minga.Mode.State.t()

Converts operator-pending state back to the base Mode.State, discarding all operator-specific fields.

total_count(operator_pending_state)

@spec total_count(t()) :: pos_integer()

Total repeat count: op_count (from before the operator key) × motion count.

For example, 3dw has op_count=3 and count=nil (motion count defaults to 1), so total_count/1 returns 3. d2w has op_count=1 and count=2, returning 2.