Buffer management commands: save/reload/quit, buffer list/navigation/kill, ex-command dispatch, and line number style cycling.
Summary
Functions
Changes the active buffer's filetype and triggers a highlight reparse.
Cleans up editor state after an agent session dies (:DOWN handler).
Refreshes editor state after SessionManager restarts a managed session.
Applies a correlated decision to the active native application-quit handshake.
Begins a native application-quit handshake without consulting confirm_quit.
Applies a correlated native file-dialog result to its BEAM-owned origin.
Opens a special buffer in a popup window or switches to it.
Normalizes shell identity and returns whether the old session is still owned.
Schedules config reload through an explicit reload implementation.
Schedules config reload with explicit data arguments for the reload implementation.
Retries one correlated lifecycle response after temporary transport pressure.
Types
@type format_terminal() :: {:committed, non_neg_integer()} | :unchanged | {:failed, term()} | :stale | :canceled
@type save_action() :: :save | {:save_quit, MingaEditor.State.Tab.id() | nil} | {:save_as, Minga.Buffer.save_intent()} | {:application_quit, non_neg_integer(), [{pid(), String.t()}], String.t()}
@type save_continuation() :: {:save_after_format, pid(), non_neg_integer(), save_action()}
@type state() :: MingaEditor.State.t()
Functions
Changes the active buffer's filetype and triggers a highlight reparse.
Used by the language picker (LanguageSource.on_select) and the :set ft=
ex command. Centralizes the side effects so both paths stay in sync.
@spec continue_after_format(state(), save_continuation(), format_terminal()) :: state()
@spec execute(state(), Minga.Mode.command()) :: state()
Cleans up editor state after an agent session dies (:DOWN handler).
The session is already dead, so no stop/unsubscribe is needed. This clears the spinner, agent state, tab session/status, and workspace.
Refreshes editor state after SessionManager restarts a managed session.
@spec handle_application_quit_decision( state(), non_neg_integer(), MingaEditor.Frontend.Protocol.application_quit_decision() ) :: state()
Applies a correlated decision to the active native application-quit handshake.
@spec handle_application_quit_request(state(), non_neg_integer()) :: state()
Begins a native application-quit handshake without consulting confirm_quit.
@spec handle_file_dialog_result( state(), non_neg_integer(), :cancel | {:open, [String.t()]} | {:save_as, String.t()} ) :: state()
Applies a correlated native file-dialog result to its BEAM-owned origin.
Opens a special buffer in a popup window or switches to it.
@spec prepare_agent_session_restart(state(), pid()) :: session_restart_ownership()
Normalizes shell identity and returns whether the old session is still owned.
@spec reload_config(state(), module()) :: state()
@spec reload_config(state(), (state() -> {:ok | {:error, String.t()}, state()})) :: state()
Schedules config reload through an explicit reload implementation.
Schedules config reload with explicit data arguments for the reload implementation.
@spec retry_application_quit_response( state(), non_neg_integer(), MingaEditor.Frontend.Protocol.application_quit_outcome(), non_neg_integer(), String.t(), String.t() ) :: state()
Retries one correlated lifecycle response after temporary transport pressure.