Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
indentation guilds highlight
rhf:
--- Quote from: ollydbg on July 24, 2009, 04:57:14 pm ---You can add these code in
sdk\editorcolourset.cpp line 506-509.
--- Code: --- if (opt->name == _T("Comment (normal)") )
{
control->StyleSetForeground(wxSCI_STYLE_INDENTGUIDE,opt->fore);
}
--- End code ---
--- End quote ---
Very good, ollydbg, it is indeed a more general solution than using the fixed setting in my reply #33 above. Now if someone could just add "Indentation guideline" to the Configure editor Syntax highlighting list, everyone could use their own settings, and we would not have to use up one of the existing highlight options. I tried to do this but couldn't figure it out.
Jenna:
--- Quote from: rhf on July 24, 2009, 10:50:31 pm ---Now if someone could just add "Indentation guideline" to the Configure editor Syntax highlighting list, everyone could use their own settings, and we would not have to use up one of the existing highlight options. I tried to do this but couldn't figure it out.
--- End quote ---
If I see it right the list is created from the lexer's content, so it can not easily be added to the list, without changing all lexers.
<Edit>
On the other hand that would be not such a hard work, because the style for the indendation guide already exists, so adding :
--- Code: --- <Style name="Indendation guide"
index="37"
fg="55,55,55"/>
--- End code ---
to sdk/resources/lexers/lexer_cpp.xml (and running update[.bat] afterwards to copy the changed file to the right place) makes the indendation guide's colour configurable at next start.
</Edit>
By the way the keyword "Comment (normal)" does not exist for all languages.
And the highlight-colour is always the same as used for matching braces:
--- Quote from: wxScintilla docu ---void SetHighlightGuide (int column)
int GetHighlightGuide()
When brace highlighting occurs, the indentation guide corresponding to the braces may be highlighted with the brace highlighting style, wxSCI_STYLE_BRACELIGHT (34). Set column to 0 to cancel this highlight.
--- End quote ---
--- Quote from: sdk/wxscintilla/src/scintilla/src/Editor.cxx:2918 --- pixmapIndentGuideHighlight->FillRectangle(rcIG, vs.styles[STYLE_BRACELIGHT].back.allocated);
pixmapIndentGuideHighlight->PenColour(vs.styles[STYLE_BRACELIGHT].fore.allocated);
--- End quote ---
That means the highlight-style can never be different from the matching-braces highlight-style without patching scintillas-sources.
ollydbg:
--- Quote from: jens on July 24, 2009, 11:13:12 pm ---
<Edit>
On the other hand that would be not such a hard work, because the style for the indendation guide already exists, so adding :
--- Code: --- <Style name="Indendation guide"
index="37"
fg="55,55,55"/>
--- End code ---
to sdk/resources/lexers/lexer_cpp.xml (and running update[.bat] afterwards to copy the changed file to the right place) makes the indentation guide's colour configurable at next start.
--- End quote ---
Really good catch!
Thanks jens!!!
That also make its color configurable in Editor->Syntax highlighting dialog.
Edit
If I change indentation guide's colour, will it be saved in my "F:\cb_svn\src\output\share\CodeBlocks\lexers\lexer_cpp.xml" ?
It seems even I close CB, this xml file leaves unchanged. But the next time I run CB, the color do persist.
So, where does the customized color configuration be saved?
Thanks.
Edit2
Well, I find the answer myself. the customized color setting was saved in "default.conf". :D
--- Code: ---<editor>
<colour_sets>
.........
<cc>
<style20>
<FORE>
<colour r="255" g="0" b="0" />
</FORE>
........
</colour_sets>
--- End code ---
rhf:
Thanks to all of you guys! This is nice work.
By the way Jens, yesterday I tried exactly the same mod to lexer_cpp.xml that you suggest in your Reply #36 and nothing happened - because, Duh!, I never ran update.
I really like having control over the style of the guide that this gives me.
Jenna:
--- Quote from: rhf on July 25, 2009, 03:39:02 pm ---Thanks to all of you guys! This is nice work.
By the way Jens, yesterday I tried exactly the same mod to lexer_cpp.xml that you suggest in your Reply #36 and nothing happened - because, Duh!, I never ran update.
I really like having control over the style of the guide that this gives me.
--- End quote ---
You should also be able to change the used lexer-xml directly.
On linux it's in /usr/share/codeblocks/lexers and on windows in <C::B-installation-directory>\share\CodeBlocks\lexers.
Or better create a subdirectory lexers in C::B's conf-dir copy the lexer-xml you want to change inside and change it (only tested on linux).
This has the advantage, that an update will not overwrite it, but of course the disadvantage that an update will not overwrite it
... even if some essentials have changed.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version