(especially since non-patched occurrence highlighting doesn't do 1-character and 2-character selections, such as variable names like i, or pt, or it).
Thomas, this is possible if you use the "Incremental Search" plugin. Just enable the IS Toolbar from the menu, then enter even single character "words" into the search field and press "highlight". I find this really useful very often.
I've just patched the code to
if(selection.Length() > 0) (therefore me referring to "unpatched"), which always works nicely, and doesn't ignore whitespace (used to trim whitespace, but it's even better without). Whitespace helps finding for example all occurrences of
i without highlighting the one in
while. Unluckily, it doesn't work nearly as well for
for(Blah::iterator it = blah.begin; ...) f(*it); because it won't find the
*it --- this is why finding (syntax aware)
references would be so interesting.
Try and rename a single-letter variable (say,
i) in a function that has more than 5 lines. It's a nightmare, and actually you should better stay away from it alltogether. When you are doing that kind of thing for a shadow warning, you spend 15-20 minutes on those 5 lines just to be sure you've not forgotten one, as that would modify the wrong variable in the wrong scope. And even then you feel bad about it afterwards. What's worst, the compiler won't even be able to warn you when it happens...
(Lesson to learn: don't use single-letter variables if you can help it. At least not in non-trivial code with several nested blocks.)