edit
edit copied to clipboard
Word highlighting in search and replace is unpredictable
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:
Changing the tags since this isn't a bug per-se. What we need is a data structure that holds a cache of search hits with an upper limit, let's say 1000 hits, which get highlighted. The structure needs to be "smart" so that we can use the cached hits for search & replace, and that it gets automatically refreshed as it gets exhausted, etc.