User forums > Using Code::Blocks
How to change the selection color of XML file?
photon3108:
XML doesn't have selection highlighting.
How to change the selection color of XML file?
Thanks.
seb_seb0:
You have 2 solutions:
1 - if the file is already open, select the menu "Edit" -> "Highlight Mode" -> "XML"
2 - for a permanent fix: go in menu "Settings" -> "Editor"
In the dialog box, choose "Syntax Highlighting" button on the left toolbar
In the ComboBox, choose the language "XML"
Click on the button "Filemasks" and type: "*.xml,*.xsl,*.xrc," in the dialog box
Click OK to close the text box
Click OK to close the dialog box
Quit Codeblocks and restart it (to save the new settings)
It works perfectly for me.
Best regards,
Sebastien
photon3108:
Thanks for your reply.
In the Syntax Highlighting, C/C++ has two members, "Selection" and "Active line".
How can I find these two members in the XML Syntax Highlighting?
seb_seb0:
Hello,
I have misunderstood your question. I thought you were speaking about "syntax" highlighting.
For coming back at your problem, I believe the only way is to write a new XML Lexer for the Scintilla component.
See here for a starting point : http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
I hope this helps.
Sebastien
Jenna:
Edit "share/codeblocks/lexers/lexer_xml.xml" in the install-folder of C:B and add:
--- Code: --- <Style name="Selection"
index="-99"
bg="192,192,192"/>
<Style name="Active line"
index="-98"
bg="255,255,160"/>
--- End code ---
After restarting C:B, you should be able to change the colour.
Navigation
[0] Message Index
[#] Next page
Go to full version