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++.
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2009-10-07095351.png)
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2009-10-07095356.png)
Hello,ollydbg:
read these codes: if( cfg->ReadBool(_T("/highlight_occurrence/enabled"), true)
&& selectedText.Len() > 2
in void HighlightOccurrences() in cbeditor.cpp
Quote from: blueshake on October 07, 2009, 05:00:17 AM
Hello,ollydbg:
read these codes: if( cfg->ReadBool(_T("/highlight_occurrence/enabled"), true)
&& selectedText.Len() > 2
in void HighlightOccurrences() in cbeditor.cpp
Thanks.
But, my question is: Why the selectedText.Len() should larger than 2?
I think it should be
selectedText.Len()>0
Maybe for some kind of Optimization.
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.
Quote from: jens on October 07, 2009, 07:21:19 AM
the decision to ignore selections with less than three characters was made, not to slow down the IDE too much.
Wasn't that configurable via editor settings or alike..?!
Quote from: MortenMacFly on October 07, 2009, 07:29:17 AM
Quote from: jens on October 07, 2009, 07:21:19 AM
the decision to ignore selections with less than three characters was made, not to slow down the IDE too much.
Wasn't that configurable via editor settings or alike..?!
I don't think so, but it can be done easily, of course.
But such an option should have a warning, that it might slow down performance when processing large files.
Please do not make it configurable. To be honest if you look e.g. at the current editor settings (see attachment) there are so many settings for character encoding that user will really get confused. We should rather think about removing some settings and not make all configurable since the usability will suffer. If we have more and more settings it will come the day that we have such a confusing dialog like eclipse and user will need one day to find a setting how to configure the font size. Such things will frustrate new users. So we should keep the benefit that codeblocks is an easy to use IDE :D
BTW: Although it has nothing to do with the functionality of Code::Blocks I find it disturbing that the text of some checkbox differ in case.
e.g.
try to detect latin-2
relative filename
Highlight Colour
etc.
I would suggest to use a capital letter at the beginning of a sentence and then only lowercase.
The other thing is the inconsistency of writing words. In some dialogs (e.g. general tab we write "case-sensitive" (highlight occurences) and in code completion tab we write "case sensitive"). Other examples are for the Todo, To-do (see attachment)
[attachment deleted by admin]
Hello!
Quote from: mariocup on October 07, 2009, 08:47:30 AM
Please do not make it configurable. To be honest if you look e.g. at the current editor settings (see attachment) there are so many settings for character encoding that user will really get confused. We should rather think about removing some settings and not make all configurable since the usability will suffer. If we have more and more settings it will come the day that we have such a confusing dialog like eclipse and user will need one day to find a setting how to configure the font size. Such things will frustrate new users. So we should keep the benefit that codeblocks is an easy to use IDE :D
Another solution is to display most common/used/important settings on a panel and put on it an "Advanced" button to display all other ones showing a hidden panel or with a new dialog. That way, it is still possible to have a fine granularity in settings without loosing the work...
Dje
I really like Dje solutions and I would like to have the option to configure the highlight selection length (without having to recompile C::B as I just did to set it to zero :D ).
Just my 2 cents...
daniloz
Quote
Another solution is to display most common/used/important settings on a panel and put on it an "Advanced" button to display all other ones showing a hidden panel or with a new dialog. That way, it is still possible to have a fine granularity in settings without loosing the work...
This sounds reasonable to have such as advanced settings.
+1 for adding advance button
Another thing that would be quite useful is if there is a way to save all the settings in some kind of a profile.
That is, because different projects have different requirements for the editor, for example:
proj1:
tab 3, use spaces, eol = unix
proj2:
tab 4, not use spaces, eol = win
And if there is a way to export the profile to external file, one can be able to give his profile to a co-worker and everybody will edit files in the project the same, so the formating issues/commits will be less frequent.
An extreme variant will be to put profiles in the project (cbp file), so the switching of the profile will be automatic
QuoteAnd if there is a way to export the profile to external file, one can be able to give his profile to a co-worker and everybody will edit files in the project the same, so the formating issues/commits will be less frequent.
Agreed. :D
Quote from: oBFusCATed on October 07, 2009, 10:16:44 AM
And if there is a way to export the profile to external file, one can be able to give his profile to a co-worker and everybody will edit files in the project the same, so the formating issues/commits will be less frequent.
+1 for this very nice and wanted 8) feature...
+1 for adding advance button.
Quote from: daniloz on October 07, 2009, 10:35:18 AM
Quote from: oBFusCATed on October 07, 2009, 10:16:44 AM
And if there is a way to export the profile to external file, one can be able to give his profile to a co-worker and everybody will edit files in the project the same, so the formating issues/commits will be less frequent.
+1 for this very nice and wanted 8) feature...
yes, but it is also possible to configure astyle properly and include an astyle step before commiting in the configuration management tool.
Dje
sorry for bump the old thread, I found a patch here:
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3130&group_id=5358
the author said that "no cpu overload detected", it that true?
sometimes I still need to hightlight one char variable.
thanks.
I'm using this on windows + Process Explorer for monitoring cpu load. There is no cpu overload because if no text selected:
if (a == b)
return
We return at the beginnig of function. Test it someone please.
I've just committed patch #3130, which makes it possible to set the minimum of characters to 1.
The default is still 3, so the current behaviour should be unchanged.
About the slowness, yes there is slowness if the setting is set at 1 and I select 'e' in codecompletion.cpp for example.
It take 1-2 seconds to select all the occurrences. But generally it works OK.