Word highlighting in search and replace is unpredictable
- Dominant language
- Rust
- Stars
- 14.6k
- Forks
- 734
- Avg merge
- 8h 40m
- Merged PRs (30d)
- 4
Description
Start with the following text in the editor:
```
This is a test.This is a test.This is a test.This is a test.This is a test.This is a test.This is a test.This is a test.
```
Press the 'end' key to position the cursor at the end of the line.
Open the Replace dialog and type "this"
I would expect either all occurrences to be highlighted, or perhaps the first one. In this case it seems to randomly choose the second instance:

Contributor guide
Research direction
Reproduce the issue in the editor using the provided text, cursor position, and Replace dialog steps, then trace the search-and-replace highlighting behavior. Done means the selected occurrence is deterministic and the reported example has a regression test covering the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100