notepad-plus-plus
notepad-plus-plus copied to clipboard
Cannot add new keywords in Lua
I am working with an application that adds functions to the Lua core library. I need to highlight these functions in a different color. I am editing the langs.xml file, but Notepad ignores the new keywords. How do I add syntax highlighting for new keywords in lua?
@PavelBlend This is a great question to ask on the Community ( https://community.notepad-plus-plus.org/ ) rather than here as an issue. But, to answer the question, I'd suggest doing what you need here:

If what you are adding are truly "keywords", maybe the INSTRUCTION WORD section is also appropriate.
I need the color of the new keywords to be different from the color of the standard functions. To do this, I created a new tag in the langs.xml file named type3. And created a new style in the stylers.xml file. But notepad ignores him.
The reason you can't add your own group of words to the lua lexer is that npp restricts the number of possible groups to be four and those are already in use. Lua lexer itself would be able to handle up to 8 different groups.
And can this restriction be removed so that it is not in the next version of Notepad?
In theory, yes and there was already some similar discussion here, but there was no outcome, so I assume this kind of feature request is not that attractive. :-(
@PavelBlend Do you still need more keywords list? If yes then how many? Lua support 8 keywords list, actually we use only 4. If necessary we can add more. https://github.com/ScintillaOrg/lexilla/blob/master/lexers/LexLua.cxx#L50 https://github.com/ScintillaOrg/lexilla/blob/master/lexers/LexLua.cxx#L446
@ArkadiuszMichalski I apologize for the long absence.
I would like to have as many keywords list as possible. That is, it is desirable to have 8 keywords list.