Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to set a lexer from a plugin?

    Plugin Development
    2
    4
    163
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dail
      dail last edited by

      Previously I used SCI_SETLEXER from a plugin so that a scintilla instance would be lexed appropriately.

      Since that message is gone I need to call CreateLexer() and use SCI_SETILEXER however a plugin can’t call CreateLexer() 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?

      dinkumoil 1 Reply Last reply Reply Quote 1
      • dinkumoil
        dinkumoil @dail last edited by

        @dail

        You could use NPPM_SETBUFFERLANGTYPE <BufferId> <LanguageCode> to set a lexer for a specific tab. LanguageCode is a constant from enum LangType in file Notepad_plus_msgs.h.

        1 Reply Last reply Reply Quote 1
        • dail
          dail last edited by

          @dinkumoil

          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.

          dinkumoil 1 Reply Last reply Reply Quote 3
          • dinkumoil
            dinkumoil @dail last edited by

            @dail

            Ah, OK. Now I understand why YOU asked that question. ;-)

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors