Buffer registration and lookup: opening files, tracking buffers in the workspace, and deduplicating tab entries.
Changes when: how we open, register, or track buffers changes.
Summary
Types
Editor state (same as MingaEditor.state()).
Functions
Applies the pure buffer-registration transition and creates its requested monitor.
Returns the index of the live buffer whose canonical path matches.
Creates one Editor-owned monitor and records its correlation reference.
Creates Editor-owned monitors for every untracked buffer pid.
Runs external cleanup around the pure retired-buffer root transition.
Types
@type open_or_activate_option() :: {:existing_target, :buffer | :tab} | {:options_server, GenServer.server() | nil} | {:start_opts, keyword()}
@type open_or_activate_result() :: {:ok, state(), pid(), open_or_activate_status()} | {:error, term()}
@type open_or_activate_status() :: :opened | :activated | :switched_tab
@type state() :: MingaEditor.State.t()
Editor state (same as MingaEditor.state()).
Functions
Applies the pure buffer-registration transition and creates its requested monitor.
@spec do_file_tree_open(state(), pid(), String.t(), Minga.Project.FileTree.t()) :: state()
@spec file_tab_for_path_in_active_workspace(state(), String.t()) :: MingaEditor.State.Tab.t() | nil
@spec find_buffer_by_path(state() | map(), String.t()) :: non_neg_integer() | nil
Returns the index of the live buffer whose canonical path matches.
Creates one Editor-owned monitor and records its correlation reference.
Creates Editor-owned monitors for every untracked buffer pid.
@spec open_or_activate_path(state(), String.t(), [open_or_activate_option()]) :: open_or_activate_result()
Runs external cleanup around the pure retired-buffer root transition.