Command execution for the editor.
Atom commands are dispatched through Minga.Command.Registry, which maps
command names to execute functions pointing at the appropriate sub-module.
Tuple commands (parameterized commands like {:insert_char, c}) still use
pattern matching since they carry runtime arguments.
Sub-modules
Commands.Movement— h/j/k/l, word, find-char, bracket, page scrollCommands.Editing— insert/delete, join, replace, indent, undo/redo, pasteCommands.Operators— d/c/y with motions and text objectsCommands.Visual— visual selection delete/yank/wrapCommands.Search— /, n/N, *, word-under-cursor searchCommands.BufferManagement— save/reload/quit, :ex commands, buffer cyclingCommands.Marks— m, ',, `` ## Action tuples When a command requires the GenServer to do something outside the purestate → statepipeline (dot-repeat replay),execute/2returns{state, {:dot_repeat, count}}. The caller (Editor`) dispatches it.
Summary
Functions
Adds a new buffer to the list and makes it active.
Executes a single command against the editor state.
Starts a new buffer process for the given file path.
Types
@type action() :: {:dot_repeat, non_neg_integer() | nil} | {:replay_macro, String.t()} | {:whichkey_update, MingaEditor.State.WhichKey.t()}
Action the GenServer must dispatch after execute/2.
@type state() :: MingaEditor.State.t()
Internal editor state.
Functions
Adds a new buffer to the list and makes it active.
@spec execute(state(), Minga.Mode.command()) :: state() | {state(), action()}
Executes a single command against the editor state.
Atom commands are resolved through the Command Registry. Tuple commands (parameterized commands) are dispatched via pattern matching.
Returns state() for the common case, or {state(), action()} when the
GenServer must dispatch a follow-up action (dot-repeat, macro replay).
Starts a new buffer process for the given file path.