microsoft / microsoft/edit

Word highlighting in search and replace is unpredictable

Open
#60 1 comment 0 reactions 0 assignees View on GitHub
C-task
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:

![Image](https://github.com/user-attachments/assets/bc404339-a11a-45b2-b697-0cb66f7abea6)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.