blu3mania / npp-papyrus

Notepad++ plugin to provide Papyrus scripting language support to Notepad++, such as syntax highlighting with automatic recognition of class names/functions/properties, keywords matching, and hyperlinks to referenced scripts. It also comes with a compiler that can provide compilation errors in a separate list window, as well as inline annotation and indication where errors are reported, plus support anonymization of compiled .pex files.
GNU General Public License v3.0
24 stars 7 forks source link

Request fro more keyword categories #22

Open dizietsma opened 2 years ago

dizietsma commented 2 years ago

Other user defined versions of Papyrus language I have found for notepad++ had more categorys of keywords (although they were not able to be configured from the style configurator of course). It would be cool to have two or three extra user sets of keywords available in the style configurator. Personally I would like to have a different colour for SKSE/F4SE functions etc. I tried editing the xml file but I had no joy, I read online that the lexer itself (dll) must support the keywrod categories?

diziet

edit: apparently I can't spell:)

blu3mania commented 2 years ago

@dizietsma Yes, it requires lexer to recognize these configured keywords and assign "states" to them, which map to configured word styles in the XML. In theory, it seems this can be simply done by adding new keywords categories in the config and let lexer read and parse them. However, unfortunately it is not that simple. For some reason NPP can only support 9 word lists, i.e. instre1, instre2, type1 to 7. In this plugin, 8 of them are already defined so at most one can be used for user defined keywords, but I want to reserve it for potential future use.

I am not sure why NPP has such a limit. From its code comments it seems there is a defined constant that limits the # of keyword lists, and that constant used to be 8 (the numbering is zero based, thus giving 9). However, it was increased to 30 in 2012 but somehow the code is still hardcoded to only support 9 lists.

blu3mania commented 2 years ago

Dependency on NPP enhancement notepad-plus-plus/notepad-plus-plus#11330.

dizietsma commented 2 years ago

Thanks for the explanation and your raising it on the NP++ issues:) In the meantime, I'm enjoying the plugin, especially the auto-detection of SkyrimSE or F4 scripts.

diziet