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.
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.
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, Path.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.
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.