Pure lifecycle owner for the TUI CUA space-leader timeout window.
Each installation advances a generation. Timeout delivery carries that generation, so cancellation and replacement remain safe even when an old timer message is already in the Editor mailbox.
Summary
Functions
Begins a new pending leader window and returns its generation.
Expires only the current pending generation.
Records the timer handle only for the current pending generation.
Returns whether a space-leader window is pending.
Cancels or consumes the current pending window without changing identity.
Returns the timer handle for best-effort cancellation by a handler.
Types
@type generation() :: non_neg_integer()
@type t() :: %MingaEditor.Shell.Traditional.SpaceLeader{ generation: generation(), pending: boolean(), timer: reference() | nil }
Functions
@spec begin(t()) :: {generation(), t()}
Begins a new pending leader window and returns its generation.
@spec expire(t(), generation()) :: {:expired | :stale, t()}
Expires only the current pending generation.
@spec install_timer(t(), generation(), reference()) :: t()
Records the timer handle only for the current pending generation.
Returns whether a space-leader window is pending.
Cancels or consumes the current pending window without changing identity.
Returns the timer handle for best-effort cancellation by a handler.