Raxol.Terminal.SearchManager (Raxol v2.0.1)
View SourceManages terminal search operations including text search, pattern matching, and search history. This module is responsible for handling all search-related operations in the terminal.
Summary
Functions
Adds a pattern to the search history. Returns the updated emulator.
Clears the search history. Returns the updated emulator.
Clears the current search. Returns the updated emulator.
Finds the next match in the search. Returns {:ok, updated_emulator, match} or {:error, reason}.
Finds the previous match in the search. Returns {:ok, updated_emulator, match} or {:error, reason}.
Gets all matches in the current search. Returns the list of matches.
Gets the search buffer instance. Returns the search buffer.
Gets the current match index. Returns the current index.
Gets the total number of matches. Returns the number of matches.
Gets the current search options. Returns the current options.
Gets the current search pattern. Returns the current pattern.
Gets the search history. Returns the list of recent search patterns.
Highlights all matches in the current view. Returns the updated emulator.
Sets the search options. Returns the updated emulator.
Starts a new search with the given pattern. Returns {:ok, updated_emulator} or {:error, reason}.
Updates the search buffer instance. Returns the updated emulator.
Functions
@spec add_to_history(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Adds a pattern to the search history. Returns the updated emulator.
@spec clear_history(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears the search history. Returns the updated emulator.
@spec clear_search(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears the current search. Returns the updated emulator.
@spec find_next(Raxol.Terminal.Emulator.t()) :: {:ok, Raxol.Terminal.Emulator.t(), Raxol.Terminal.SearchBuffer.match()} | {:error, String.t()}
Finds the next match in the search. Returns {:ok, updated_emulator, match} or {:error, reason}.
@spec find_previous(Raxol.Terminal.Emulator.t()) :: {:ok, Raxol.Terminal.Emulator.t(), Raxol.Terminal.SearchBuffer.match()} | {:error, String.t()}
Finds the previous match in the search. Returns {:ok, updated_emulator, match} or {:error, reason}.
@spec get_all_matches(Raxol.Terminal.Emulator.t()) :: [ Raxol.Terminal.SearchBuffer.match() ]
Gets all matches in the current search. Returns the list of matches.
@spec get_buffer(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.SearchBuffer.t()
Gets the search buffer instance. Returns the search buffer.
@spec get_current_index(Raxol.Terminal.Emulator.t()) :: integer()
Gets the current match index. Returns the current index.
@spec get_match_count(Raxol.Terminal.Emulator.t()) :: non_neg_integer()
Gets the total number of matches. Returns the number of matches.
@spec get_options(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.SearchBuffer.options()
Gets the current search options. Returns the current options.
@spec get_pattern(Raxol.Terminal.Emulator.t()) :: String.t() | nil
Gets the current search pattern. Returns the current pattern.
@spec get_search_history(Raxol.Terminal.Emulator.t()) :: [String.t()]
Gets the search history. Returns the list of recent search patterns.
@spec highlight_matches(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Highlights all matches in the current view. Returns the updated emulator.
@spec set_options(Raxol.Terminal.Emulator.t(), Raxol.Terminal.SearchBuffer.options()) :: Raxol.Terminal.Emulator.t()
Sets the search options. Returns the updated emulator.
@spec start_search(Raxol.Terminal.Emulator.t(), String.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Starts a new search with the given pattern. Returns {:ok, updated_emulator} or {:error, reason}.
@spec update_buffer(Raxol.Terminal.Emulator.t(), Raxol.Terminal.SearchBuffer.t()) :: Raxol.Terminal.Emulator.t()
Updates the search buffer instance. Returns the updated emulator.