Enable Lexer available in Scintilla
Scintilla has about 100+ lexers and NPP has around 50+ lexers.
If a lexer which is present in Scintilla needs to be enabled in NPP… what should be done?
Is there any documentation available for the same?
Having an External Lexer could be an option, but wouldn’t that be a overhead to re-implement the same thing done in Scintilla?
Take a look at this issue I created a while ago. It lists all the Scintilla lexer that aren’t being used currently.
what should be done?
Take a look at this pull request, that for some reason hasn’t been merged. This is really the minimum requirements to support a new Scintilla lexer.
Thx for your response.
I should create a new merge request similar to the Visual Prolog.
I should create the next lexer with the define (IDM_LANG + 60) in PowerEditor/src/menuCmdID.h … assuming Visual Prolog would be merged… right?
Apart from that, PowerEditor/src/ScitillaComponent/ScintillaEditView.h allows LIST_0 to LIST_6 to be passed on to setLexer()… if I remember correctly, Scintilla allows to have 9 WordList by default. Is NPP decision to allow 7 WordList is a design consideration or we can extend it based on the requirement?
assuming Visual Prolog would be merged… right?
I would not assume it will be merged. It’s been open a long time so I doubt it will get merged soon. Part of the problem with adding new lexers is that every time one is added then it can cause merge conflicts with all the other requests (Just a pain we have to live with though).
if I remember correctly, Scintilla allows to have 9 WordList by default
Yes, that is correct.
Is NPP decision to allow 7 WordList is a design consideration or we can extend it based on the requirement?
I believe it is because there currently has not been a need. Some minor code modifications would be needed to support having 9 WordLists but shouldn’t be any major problem.
I tried compiling scintillas visual prolog lexer into my external lexer plugin.
It is a complete hack for now but if it makes anyone happy I may work on it some more someday.
You can download it here:
lexamples with prolog
The lexer should appear as ‘VVV’ in the languages menu.
I could not test it since I don’t know prolog.
It seems that comments work.
You need to set styling colors manually from Setting -> Style configurator and save them.