editor: Inherit whole word match from buffer search (#64137)
# Objective
Make `editor: select next` / `editor: select previous` more powerful and
conform to VSCode behaviour
Partial fix for #15415
## Solution
When `editor: select next`/`editor: select previous`/`editor: select
all` is used from an existing selection, it'll now inherit whole-word
from the buffer search bar, while it's open.
If those commands are used starting from a single caret, continue to
always match whole words, with case sensitivity continuing to be
configurable in that case.
## Testing
Test both manually, as well as with unit tests:
- Updated `editor::editor_tests::test_select_next` with new assertion
for whole-word matching
- Added
`search::buffer_search::tests::test_set_active_pane_item_syncs_select_search_options`
- Added
`search::buffer_search::tests::test_search_option_change_during_selections`
- Added
`search::buffer_search::tests::test_show_syncs_select_search_options`
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Improved `editor: select next` and `editor: select previous` to
respect the buffer search whole-word option.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
baee1ca6deAlessandro Martone committed on 9/24/2026, 9:52:26 AM· committed by GitHubparenta405fb9