Add a find/replace bar to the editor
Ctrl+F opens a find bar above the editor (Ctrl+H focuses the replace field; Edit ▸ Find / Replace… opens it too). Matches are shaded in the editor with the active one highlighted more strongly; Enter/Shift+Enter and ▼/▲ step through them with wraparound and scroll-to-view. An "Aa" toggle controls case sensitivity. Replace swaps the current match and advances; Replace all swaps every match in one pass. Esc closes the bar. Search/replace logic lives in pure, unit-tested functions (find_matches, replace_all) with non-overlapping matching and correct multibyte offset mapping for case-insensitive search. Highlighting reuses the editor's layout-job builder alongside the grammar underlines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9kRuP7JvXoUGdNNeg5ZSs
This commit is contained in:
@@ -85,6 +85,14 @@ Terminal=false
|
||||
| `Ctrl/Cmd + E` | `inline code` |
|
||||
| `Ctrl/Cmd + Shift + X` | ~~strikethrough~~ (`~~…~~`) |
|
||||
| `Ctrl/Cmd + K` | link — `[selection](url)`, with `url` selected to replace |
|
||||
|
||||
Press **`Ctrl/Cmd + F`** (or **Edit ▸ Find / Replace…**) to open the
|
||||
find/replace bar above the editor; **`Ctrl/Cmd + H`** opens it with the
|
||||
replace field focused. Type a search term to shade every match in the editor
|
||||
(the current one brighter); **Enter** / **Shift+Enter** (or **▼** / **▲**)
|
||||
step through them, wrapping around, and scroll the match into view. **Aa**
|
||||
toggles case sensitivity. **Replace** swaps the current match and advances;
|
||||
**Replace all** swaps every match in the file at once. **Esc** closes the bar.
|
||||
4. Set the **Chapter title** for the open file if you want to override the
|
||||
auto-derived one (the field shows the automatic title as a hint). Leaving it
|
||||
blank falls back to a `# Title:` line in the header, and if there is none, to
|
||||
|
||||
Reference in New Issue
Block a user