+14

Find/Quick Add Next consistent with highlighted occurrences

pornel hace 12 años actualizado por 0xeedfade hace 12 años 2

In a document like that:

bar foobarbaz bar foo bar

If I double-click "bar" I see words highlighted (outlined) based on whole-word find (very nice!)

[bar] foobarbaz [bar] foo [bar]

But then when I invoke "Quick Add Next" a few times I get different selection based on substring match:

bar foobarbaz bar foo bar

Notice that "bar" fragment in "foobarbaz" is unexpectedly selected, even though it hasn't been highlighted as a match before.

I wish those two features were aligned. Specifically I'd like to have "Quick Add Next Whole-Word Match" option, so it'd only select words I can already see highlighted.

Whole-word Quick Add Next is also very useful for renaming variables within a function, but currently it only works reliably when the name doesn't match substring (e.g. can't rename "i" variable, even though whole-word match would do well).

I wouldn't mind a bit of magic here too - use whole-word Quick Add if whole word is selected, and use substring if selection doesn't end on word boundaries.

Holy moly, this drives me crazy too! I would love for this to be resolved somehow. Either a separate shortcut for something like "Quick Add Next Matched" or just modify the behavior of Quick Add Next.

+6

This is rather baffling. Unintituively, Quick Add Next behaves differently depending on the state of your selection (as not stated in the help). If you select a pattern, it will match any pattern following. If you only have your caret on your word (no selection), it will select only whole words.