Wires regex matching into the search session and the terminal frontend. SearchSession gains `regex` and `invalid` flags. search_begin takes a `regex` argument; recompute dispatches find_all_regex (regex) vs find_all (literal), recording `invalid` when the pattern won't compile (an invalid pattern clears the matches and shows [invalid] rather than a stale count). search_toggle_regex flips the mode and re-runs the current query. Input: C-M-s / C-M-r start a regex search (search.forward-regex / search.backward-regex commands → ed.search_start(forward, regex)). M-r toggles literal <-> regex mid-search — a new SearchKey decoded in dispatch_search_key, so it works the same in both frontends (the GUI already round-trips every key while searching). The TUI prompt reads "Regex I-search:" in regex mode and "[invalid]" when the pattern won't compile. Multi-line: SearchView now washes each row a match spans, mirroring paint_local_selection's per-row clip (newline excluded so a spanning match doesn't paint a phantom trailing cell). Single-line matches — every literal match — touch exactly one row, unchanged. The GPU already fans multi-line ranges per-line, so it needs no change here. Tests: regex match / smart-case / invalid-flags-and-recovers / toggle-reinterprets-query (core); C-M-s starts regex + M-r toggles mid-search (dispatch); multi-line per-row wash (SearchView render). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| commands | ||
| hooks | ||
| keymaps | ||
| packages/repl | ||
| runtime | ||