How to set a lexer from a plugin?
-
Previously I used
SCI_SETLEXERfrom a plugin so that a scintilla instance would be lexed appropriately.Since that message is gone I need to call
CreateLexer()and useSCI_SETILEXERhowever a plugin can’t callCreateLexer()since it is implemented in SciLexer.dll.Does a new Notepad++ message need to be created to have Notepad++ call
CreateLexer()on behalf of a plugin? Am I missing something? -
You could use
NPPM_SETBUFFERLANGTYPE <BufferId> <LanguageCode>to set a lexer for a specific tab.LanguageCodeis a constant fromenum LangTypein file Notepad_plus_msgs.h. -
I’m using NPPM_CREATESCINTILLAHANDLE to create a couple of instances not managed by Notepad++. E.g. LuaScript has an instance in the console that highlights Lua.
NPPM_SETBUFFERLANGTYPE won’t work in this case.
-
Ah, OK. Now I understand why YOU asked that question. ;-)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login