Bug conditions and effect
This seems to be a bug, or at least an unintuitive behaviour that only happens when the search bar is opened (after pressing ctrl+F, etc.) AND you selected a word part that is not already the string in the Find field (e.g. you searched for TOP before, and then you selected GRID).
The bug seems to be due to the specific behavior of find_under_expand
while searching. In search mode, it will fill the Find field with the whole word under the caret on the first call, then starts finding and adding more occurrences to the selection. But it has some inconsistencies. For instance, if you click on different words one after the other, pressing ctrl+D after each click, and it will always fill the Find field with the word, but will alternatively not highlight the word and highlight it.
When you select a sub-word, it gets worse and only the next sub-word gets highlighted the first time you press ctrl+D. The following times, you get a mix of fill Find field, cursor goes to end of word and extend selection (a behavior that made sense on a single and complete word) which results in the selection of the first two words, with the second word (GRID_SPACING
) filling the Find field.
Workaround
Solution 1
Close the search bar with esc and then use ctrl+D / Find > Quick Add Next
repeatedly. Note that the selection won't be highlighted as searched strings (yellow in the default theme), but only as normal selection highlight (gray in the default theme).
Solution 2
If, after your first ctrl+D, you realized that your search bar was opened (and the Find field did not previously contain your target sub-word), it is not too late. Press ctrl+U / Edit > Undo Selection > Soft Undo
to go back to the original sub-word selected. From here, use ctrl+D repeatedly. With the Find field containing the target sub-word, selection will behave as expected.
GRID
in its entirety and hittingCtrl+D
three times selects all instances ofGRID
, nothing more. Have you added any keybindings toPreferences -> Key Bindings – User
, or adjusted any related settings inPreferences -> Settings – User
? Also, does the same problem happen when usingFind -> Quick Add Next
instead ofCtrl+D
? Are there any external packages that could be interfering?