Expand description
Headless find & replace engine (literal and regex search, single-undo batch replace).
Structs§
- Search
Query - A headless find query: literal substring or regex, with case and
whole-word toggles. Compiled to a [
regex::Regex] on use. - Search
State - Version-cached search state for interactive find (prompt, vim
/).
Functions§
- collect_
replacements - Collects
(range, expanded_text)pairs forqueryintext, with 0-based ascending ranges. - compile_
query - Compiles a
SearchQueryinto a [regex::Regex]. - find_
matches - Returns all match byte ranges for
queryinbuffer, in ascending order. - find_
next - Returns the first match at or after
from_offset, wrapping to the start whenwrapis set. ReturnsOk(None)when there are no matches. - find_
prev - Returns the last match at or before
from_offset, wrapping to the end whenwrapis set. ReturnsOk(None)when there are no matches. - replace_
all_ query - Replaces all matches of
querywithreplacementas a single undoable transaction. Supports$1/$namecapture expansion in regex mode; literal mode usesreplacementverbatim. Returns the number of replacements applied. - replace_
one_ query - Replaces the single match
rangewithreplacement(undoable).