Cannot add more then 2 keyword lists

Topics: User Forum
Mar 15, 2013 at 10:00 PM
Edited Mar 15, 2013 at 10:03 PM
Hello ScintillaNET community! First of all, thanks for developing this excellent control: it is the best out there.

I have had only one problem. I have tried many different things but I still cannot add more than 2 keyword lists (I am using one list for keywords, the second for class names, and the third for member names, such that each item can have its correct color)

Here is my code (put in the constructor of DocumentForm in Scide):
        Configuration config = new Configuration("cs");
        config.Lexing_Keywords.Add(new KeyWordConfig(0, "TEST1", false));
        config.Lexing_Keywords.Add(new KeyWordConfig(1, "TEST2", false));
        config.Lexing_Keywords.Add(new KeyWordConfig(2, "Else ElseIf EndFor EndIf EndSub EndWhile For Goto If Step Sub Then To While And Or", false));

        config.Markers_List = new MarkersConfigList();
        this.scintilla.ConfigurationManager.Language = "cs";
        this.scintilla.ConfigurationManager.IsBuiltInEnabled = false;
        this.scintilla.ConfigurationManager.IsUserEnabled = true;
        this.scintilla.ConfigurationManager.Configure(config);
EDIT: I am using Release 2.5.2
Developer
Mar 16, 2013 at 3:29 AM
Provided the first 2 keyword lists are highlighting correctly, the issue is that keyword list number 2 for the cpp lexer is for documentation comment keywords. What you want is keyword list number 4, which is used in the same context as the first 2.
Mar 16, 2013 at 3:41 AM
Thank you so much! I changed the index from 2 to 3 (zero-based) and now it works perfectly.