Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4668 User defined languages: sort list of keywords descending before use

Non-Specific
open
nobody
None
5
2014-01-29
2014-01-29
No

You can define several lists of keywords (styler) for user defined languages, e.g. for open, middle, close, ...
If you define in such a list keywords "IF" and "IF-CMD-ERROR" (in that order!), the only "IF" will be highlighted in "IF-CMD-ERROR", and the rest will be in the default color.
The same applies if you define macros "@OF" and "@OFRE": only "@OF" is shown in highlight color in "@OFRE", the rest ("RE") is shown in the default color.
But you can make a walkaround for this, by first sorting all those lists in descending order, e.g. "IF-CMD-ERROR IF" or "@OFRE @OF". When NPP encounters such a keyword, it will first match "IF-CMD-ERROR" or "OFRE" rather than "IF" or "@OF".
Therefore my suggestion: when NPP reads the lists with keywords, it should always sort them (internally) in descending order, before using them.

Discussion