Groups search-related fields from EditorState.
Tracks the last search pattern and direction (for n/N repeat),
the pending project-wide search query (read off the editor path by the
project search picker source), and the complete GUI search session.
Summary
Functions
Accepts a source-owned generation only for the exact live search revision.
Installs an exact line-local incremental index update.
Checks whether a completed build still targets the exact live search revision.
Accepts a complete native query edit only for the active session and a newer sequence.
Targets the active GUI session at a buffer and marks its build pending.
Dismisses the GUI search toolbar.
Records an explicit asynchronous search failure for the exact live request.
Starts a fresh GUI search session while preserving its query and options.
Returns the active GUI query options.
Returns the stable query revision for the active GUI search session.
Returns whether the GUI search toolbar is active.
Returns a ready generation only at the exact active buffer revision.
Invalidates the accepted revision and retains prior results only for pending display.
Records the last search pattern and direction.
Records just the last search pattern (keeps existing direction).
Returns the bounded renderer projection without copying the index.
Sets just the last search direction.
Stores the pending project-wide search query for the async picker source.
Types
@type gui_search() :: MingaEditor.State.Search.Session.t()
Retained authoritative GUI search session, including inactive sessions.
@type t() :: %MingaEditor.State.Search{ gui_search: gui_search() | nil, last_direction: Minga.Editing.Search.direction(), last_pattern: String.t() | nil, project_query: String.t() | nil }
Functions
@spec accept_gui_generation( t(), non_neg_integer(), pid(), Minga.Search.IndexGeneration.t() ) :: {:accepted, t()} | {:stale, t()}
Accepts a source-owned generation only for the exact live search revision.
@spec accept_gui_incremental(t(), Minga.Search.IndexGeneration.t()) :: t()
Installs an exact line-local incremental index update.
@spec accepts_gui_generation?(t(), non_neg_integer(), pid()) :: boolean()
Checks whether a completed build still targets the exact live search revision.
@spec apply_gui_search_edit( t(), non_neg_integer(), non_neg_integer(), String.t(), boolean(), boolean(), boolean() ) :: {:accepted, t()} | {:stale, t()}
Accepts a complete native query edit only for the active session and a newer sequence.
Targets the active GUI session at a buffer and marks its build pending.
Dismisses the GUI search toolbar.
@spec fail_gui_search(t(), non_neg_integer(), pid(), String.t()) :: {:accepted, t()} | {:stale, t()}
Records an explicit asynchronous search failure for the exact live request.
Starts a fresh GUI search session while preserving its query and options.
@spec gui_options(t()) :: Minga.Editing.Search.search_opts()
Returns the active GUI query options.
@spec gui_query_revision(t()) :: non_neg_integer()
Returns the stable query revision for the active GUI search session.
Returns whether the GUI search toolbar is active.
@spec ready_gui_generation(t(), pid(), {non_neg_integer(), non_neg_integer()}) :: {:ok, Minga.Search.IndexGeneration.t()} | :stale
Returns a ready generation only at the exact active buffer revision.
@spec rebuild_gui_search(t(), Minga.Buffer.EditDelta.t() | nil) :: t()
Invalidates the accepted revision and retains prior results only for pending display.
@spec record(t(), String.t(), Minga.Editing.Search.direction()) :: t()
Records the last search pattern and direction.
Records just the last search pattern (keeps existing direction).
@spec render_snapshot(t(), pid() | nil, Minga.Editing.Search.position()) :: MingaEditor.State.Search.Projection.t()
Returns the bounded renderer projection without copying the index.
@spec set_last_direction(t(), Minga.Editing.Search.direction()) :: t()
Sets just the last search direction.
Stores the pending project-wide search query for the async picker source.