Records and replays named keystroke macros.
A pure functional module — no GenServer. The struct is embedded in
MingaEditor.State and threaded through the editor's key dispatch.
Macros are stored in named registers (a–z), separate from text
registers. Each register holds a list of key tuples that can be
replayed through the editor's handle_key pipeline.
Summary
Types
A key event: {codepoint, modifiers}.
Recording state: {register_name, accumulated_keys} or nil.
Functions
Returns the stored key sequence for a register, or nil.
Returns a fresh macro recorder with no recorded macros.
Appends a key to the active recording. No-op if not recording.
Returns {true, register_name} if recording, or false.
Returns true if currently replaying a macro.
Begins recording into the named register.
Sets the replaying flag.
Finalizes the current recording, storing the key sequence in the register.
Clears the replaying flag.
Types
@type key() :: {non_neg_integer(), non_neg_integer()}
A key event: {codepoint, modifiers}.
Recording state: {register_name, accumulated_keys} or nil.
Functions
Returns the stored key sequence for a register, or nil.
@spec new() :: t()
Returns a fresh macro recorder with no recorded macros.
Appends a key to the active recording. No-op if not recording.
Returns {true, register_name} if recording, or false.
Returns true if currently replaying a macro.
Begins recording into the named register.
Sets the replaying flag.
Finalizes the current recording, storing the key sequence in the register.
Clears the replaying flag.