User forums > Using Code::Blocks

highlight of the select variable problem

(1/4) > >>

ollydbg:
Hi, it seems there are some difference of the highlight mechanism between CB and notepad++.

If I only select a variable which has only a character. In notepad++, all the other variable will be highlighted. But in CB, this can't work.

See the screen of both CB and notepad++.



blueshake:
Hello,ollydbg:
read these codes:
--- Code: ---        if( cfg->ReadBool(_T("/highlight_occurrence/enabled"), true)
                && selectedText.Len() > 2   
--- End code ---
in     void HighlightOccurrences() in cbeditor.cpp

ollydbg:

--- Quote from: blueshake on October 07, 2009, 05:00:17 am ---Hello,ollydbg:
read these codes:
--- Code: ---        if( cfg->ReadBool(_T("/highlight_occurrence/enabled"), true)
                && selectedText.Len() > 2  
--- End code ---
in     void HighlightOccurrences() in cbeditor.cpp

--- End quote ---

Thanks.
But, my question is: Why the selectedText.Len() should larger than 2?
I think it should be


--- Code: ---selectedText.Len()>0
--- End code ---

blueshake:
Maybe for some kind of Optimization.

Jenna:
Highlight Occurrences does not highlight all occurrences of a variable, but all occurrences of a character.
And it is called from UpdeteUI.

It searches the whole editor for occurrences and sets the indicator-style for it (and for the second control in split-mode) so the decision to ignore selections with less than three characters was made, not to slow down the IDE too much.

Navigation

[0] Message Index

[#] Next page

Go to full version