Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Occurrences highlighting

<< < (8/9) > >>

carra:
Thanks daniloz, you saved me the work :) I think in that screenshot the first one is selected and the rest aren't, but one has to really focus to see it...

And by the way, the problem also happens for single selection. It is just less of a problem (it is easy to remember what you selected if it's only one thing ;) )

thomas:

--- Quote from: MortenMacFly on November 13, 2012, 05:42:33 pm ---
--- Quote from: thomas on November 13, 2012, 03:58:21 pm ---(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).

--- End quote ---
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.

--- End quote ---
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.)

MortenMacFly:

--- Quote from: thomas on November 13, 2012, 05:57:53 pm ---Try and rename a single-letter variable (say, i) in a function that has more than 5 lines.
--- End quote ---
Technically its possible: Scintilla offers multiple selections (not necessarily bound together)  an also writing to multiple selections. CC could offer the interface to local variables, bringing both together allows what you want.

dmoore:
I find I get by pretty well with "match case + whole word" or regexp replaces. Something more interactive might be nice, but it might also be a lot of work for small result. Slightly offtopic, but, IMO, it would also be useful to be able to perform operations on the items in the find in files results list.

daniloz:

--- Quote from: dmoore on November 13, 2012, 08:40:57 pm ---I find I get by pretty well with "match case + whole word" or regexp replaces. Something more interactive might be nice, but it might also be a lot of work for small result.

--- End quote ---

I have to disagree with you here. I do agree that from a developer perspective "match case + whole word" or regexp replaces is just fine and the work for implementing something more interactive is not worth...

However, IMHO, from a typical user perspective, I think that would be a very nice feature because:

1- the user maybe is not acquainted with regexp
2- the user may feel more safe if there's something interactive to do the replaces, i.e. he may fell that he's not missing something

I'm fine with the actual "match case + whole word" or regexp replaces, but wanted to leave my 2 cents here....

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version