Groups search-related fields from EditorState.
Tracks the last search pattern and direction (for n/N repeat),
cached project-wide search results for the picker, and the GUI search
toolbar state (active, flags, replace mode).
Summary
Functions
Activates the GUI search toolbar with the given flags.
Dismisses the GUI search toolbar.
Returns whether the GUI search toolbar is active.
Records the last search pattern and direction.
Records just the last search pattern (keeps existing direction).
Sets replace mode on the GUI search toolbar.
Sets just the last search direction.
Replaces the cached project search results.
Updates the GUI search toolbar flags. Activates the toolbar with replace_mode: false if not already active.
Types
@type gui_search() :: %{ replace_mode: boolean(), case_sensitive: boolean(), whole_word: boolean(), regex: boolean() }
GUI search toolbar state. Non-nil means the toolbar is active.
@type t() :: %MingaEditor.State.Search{ gui_search: gui_search() | nil, last_direction: Minga.Editing.Search.direction(), last_pattern: String.t() | nil, project_results: [Minga.Project.ProjectSearch.match()] }
Functions
Activates the GUI search toolbar with the given flags.
Dismisses the GUI search toolbar.
Returns whether the GUI search toolbar is active.
@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).
Sets replace mode on the GUI search toolbar.
@spec set_last_direction(t(), Minga.Editing.Search.direction()) :: t()
Sets just the last search direction.
@spec set_project_results(t(), [Minga.Project.ProjectSearch.match()]) :: t()
Replaces the cached project search results.
Updates the GUI search toolbar flags. Activates the toolbar with replace_mode: false if not already active.