editor: Highlight all matching occurrences of text in selection (#24835)

Closes #12635

- [x] Get it working
- [x] Disable for multi cursor
- [x] Disable for vim visual line selection
- [x] Add setting to disable it
- [x] Add scrollbar marker
- [x] Handle delete state capturing selection

Preview:

https://github.com/user-attachments/assets/a76cde64-4f6c-4575-91cc-3a03a954e7a9

Release Notes:

- Added support to highlight all matching occurrences of text within the
selection in editor.

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
This commit is contained in:
smit 2025-02-18 00:51:14 +05:30 committed by GitHub
parent 1e1b637b50
commit 3e9722685b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 144 additions and 2 deletions

View file

@ -472,6 +472,19 @@ List of `string` values
"current_line_highlight": "all"
```
## Selection Highlight
- Description: Whether to highlight all occurrences of the selected text in an editor.
- Setting: `selection_highlight`
- Default: `true`
## Selection Highlight Debounce
- Description: The debounce delay before querying highlights based on the selected text.
- Setting: `selection_highlight_debounce`
- Default: `75`
## LSP Highlight Debounce
- Description: The debounce delay before querying highlights from the language server based on the current cursor location.
@ -532,6 +545,7 @@ List of `string` values
"cursors": true,
"git_diff": true,
"search_results": true,
"selected_text": true,
"selected_symbol": true,
"diagnostics": "all",
"axes": {
@ -611,6 +625,16 @@ List of `string` values
`boolean` values
### Selected Text Indicators
- Description: Whether to show selected text occurrences in the scrollbar.
- Setting: `selected_text`
- Default: `true`
**Options**
`boolean` values
### Selected Symbols Indicators
- Description: Whether to show selected symbol occurrences in the scrollbar.