MingaEditor.State.WhichKey (Minga v0.1.0)

Copy Markdown View Source

Pure lifecycle owner for delayed which-key presentation.

Summary

Functions

Returns whether a leader prefix is active.

Begins a new hidden which-key generation.

Dismisses which-key while retaining its monotonic generation.

Moves to the next display page.

Moves to the previous display page.

Advances a leader prefix with a new generation while preserving visibility.

Records the timer handle only for the current active generation.

Reveals only the matching active generation.

Returns whether the popup is visible.

Types

generation()

@type generation() :: non_neg_integer()

t()

@type t() :: %MingaEditor.State.WhichKey{
  generation: generation(),
  node: Minga.Keymap.Bindings.node_t() | nil,
  page: non_neg_integer(),
  prefix_keys: [String.t()],
  show: boolean(),
  timer: reference() | nil
}

Functions

active?(which_key)

@spec active?(t()) :: boolean()

Returns whether a leader prefix is active.

begin(whichkey, node, prefix_keys)

@spec begin(t(), Minga.Keymap.Bindings.node_t(), [String.t()]) :: t()

Begins a new hidden which-key generation.

dismiss(whichkey)

@spec dismiss(t()) :: t()

Dismisses which-key while retaining its monotonic generation.

next_page(whichkey)

@spec next_page(t()) :: t()

Moves to the next display page.

previous_page(whichkey)

@spec previous_page(t()) :: t()

Moves to the previous display page.

progress(whichkey, node, prefix_keys)

@spec progress(t(), Minga.Keymap.Bindings.node_t(), [String.t()]) :: t()

Advances a leader prefix with a new generation while preserving visibility.

record_timer(whichkey, generation, timer)

@spec record_timer(t(), generation(), reference()) :: t()

Records the timer handle only for the current active generation.

reveal(whichkey, generation)

@spec reveal(t(), generation()) :: t()

Reveals only the matching active generation.

visible?(which_key)

@spec visible?(t()) :: boolean()

Returns whether the popup is visible.