Focused workflow for window focus, buffer cursor calls, and shell focus presentation.
Summary
Functions
Focuses a window after saving and restoring its buffer cursor state.
Focuses a window and reports why an ownership-safe transition was rejected.
Focuses a surviving window after the active split was removed.
Snapshots the active cursor only when the active window owns its buffer source.
Snapshots the active cursor and reports ownership failures without changing state.
Repairs a window with a viable buffer or empty surface, then restores focus to it.
Restores focus without reading the outgoing window's buffer, for popup dismissal.
Types
@type focus_failure() ::
:window_not_found | :cursor_source_mismatch | :buffer_unavailable
@type focus_result() :: {:ok, state()} | {:error, focus_failure()}
@type state() :: MingaEditor.State.t()
Functions
@spec focus(state(), MingaEditor.Window.id()) :: state()
Focuses a window after saving and restoring its buffer cursor state.
@spec focus_result(state(), MingaEditor.Window.id()) :: focus_result()
Focuses a window and reports why an ownership-safe transition was rejected.
@spec focus_surviving_window( state(), MingaEditor.State.Windows.t(), MingaEditor.Window.id() ) :: state()
Focuses a surviving window after the active split was removed.
Snapshots the active cursor only when the active window owns its buffer source.
@spec remember_active_cursor_result(state()) :: focus_result()
Snapshots the active cursor and reports ownership failures without changing state.
@spec repair_focus(state(), MingaEditor.Window.id()) :: {:ok, state()} | :error
Repairs a window with a viable buffer or empty surface, then restores focus to it.
@spec restore_focus(state(), MingaEditor.Window.id()) :: {:ok, state()} | :error
Restores focus without reading the outgoing window's buffer, for popup dismissal.