Skip to main content

Module search

Module search 

Source
Expand description

Shared search-match scanning.

One canonical “pattern → match ranges within a line” implementation for every consumer that needs to know WHERE a search pattern matches:

  • hjkl-engine’s SearchState per-row match cache (n/N navigation),
  • hjkl-buffer-tui’s hlsearch painting (BufferView::row_search_ranges),
  • the app’s quickfix-dock match overlay (highlighting the :grep pattern inside each entry’s message text).

All three previously (or would otherwise) hand-roll the same find_iter → (start, end) expression; keeping it here — the lowest crate they all already depend on — guarantees they can never disagree about what counts as a match.

Functions§

search_match_ranges
Byte ranges ((start, end), half-open) of every non-overlapping match of re in line, in order. Empty when nothing matches.