Goal: Add Emacs-shaped incremental search for fast navigation inside the current buffer.
Context: Markdown-heavy work needs quick search before Cortex feels usable for real notes and docs.
The PRD reserves C-s for forward isearch and C-r for reverse isearch.
This should build on the minibuffer foundation if that has landed.
Proposed approach:
- Add search state that owns query text, direction, active match, and original point.
- Bind
C-s to start forward search and repeat forward while search is active.
- Bind
C-r to start reverse search and repeat backward while search is active.
- Update the active match as the query changes.
- Render the search prompt and a visible active match with restrained styling.
- Escape cancels and restores the original point.
- Enter accepts the current match and exits search.
Acceptance criteria:
C-s starts forward incremental search.
- Typing updates the query without editing the buffer.
- Matching moves point to the current match as the query changes.
- Repeating
C-s moves to the next match.
C-r searches backward or repeats backward while search is active.
- Escape cancels search and restores the original point.
- Enter accepts the current match.
- No-match state is visible and does not move point unexpectedly.
- Existing editing, save, quit, command line/minibuffer, picker, and highlighting behavior still works.
Verification:
- Run
cargo test.
- Manually search forward and backward in a Markdown file.
- Manually test no-match, cancel, accept, repeated search, save, and terminal cleanup.
Out of scope:
- Regex search.
- Replace.
- Project-wide search.
- Search history.
- Multi-buffer search.
Goal: Add Emacs-shaped incremental search for fast navigation inside the current buffer.
Context: Markdown-heavy work needs quick search before Cortex feels usable for real notes and docs.
The PRD reserves
C-sfor forward isearch andC-rfor reverse isearch.This should build on the minibuffer foundation if that has landed.
Proposed approach:
C-sto start forward search and repeat forward while search is active.C-rto start reverse search and repeat backward while search is active.Acceptance criteria:
C-sstarts forward incremental search.C-smoves to the next match.C-rsearches backward or repeats backward while search is active.Verification:
cargo test.Out of scope: