Did you try menu "Settings" -> "Editor" -> "Syntax Highlighting" -> Button "Keywords" first? Here you can setup additional user keywords for each (!) lexer. I think this is way better than hacking scintilla (the lexer's code) itself.
I think the easiest (and probably best) way to support this language would be to copy lexer_cpp.xml to lexer_lcp.xml and modify the file masks and keywords. However, this would still only give you two color sets for highlighted keywords, and if I am understanding you correctly, you want three, right?Correct. I started out this way, experimenting with indexes and such as well. But I cannot get 3 sets of keywords :(
There are other modifications. Follow the variable keywords2 around LexCPP.cxx and do a threaded searches for SCE_C_WORD2 and wxSCI_C_WORD2. That should provide an example, and the locations for modifications.
Malc -> perhaps you have not to modify all these files. Look into them. I don't remember exactly because I rewrote a lexer from scratch for me, and you just want to modify an existing one.
<Style name="Global classes and typedefs"
index="19"
fg="190,0,190"
bold="1"/>
<Set index="3"
value="my list of keywords"/>
Wait! No programming of the lexer necessary! Add:
Index: src/sdk/wxscintilla/src/scintilla/lexers/LexCPP.cxx
===================================================================
--- src/sdk/wxscintilla/src/scintilla/lexers/LexCPP.cxx (revision 8148)
+++ src/sdk/wxscintilla/src/scintilla/lexers/LexCPP.cxx (working copy)
@@ -221,7 +221,7 @@
bool highlightWxSmith;
/* C::B end */
OptionsCPP() {
- stylingWithinPreprocessor = false;
+ stylingWithinPreprocessor = true;
identifiersAllowDollars = true;
trackPreprocessor = true;
updatePreprocessor = true;
(To do it properly, this should actually be connected to a checkbox in the settings.)Which are roughly 3 lines of code and a checkbox in a XRC file you can modify with C::B. Patches are welcome. (Not from you, Alpha - you've done enough already...)