Community
    • Login

    What makes a custom lexer appear as item in the Prefrences > Indentation list?

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    6 Posts 4 Posters 204 Views
    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.
    • Bas de ReuverB
      Bas de Reuver
      last edited by

      I’ve created the CSV Lint plug-in and someone posted an issue about not being able to save the Indentation.

      I didn’t know about this feature, but the “CSV Lint” is somehow in this list. I want to remove it from this dialog, but I don’t know what makes a custom lexer appear as item in the Prefrences > Indentation list? Why is the CSV Lint plugin in this list?

      In the lexer class, I’ve tried removing the public IDocumentGetLineIndentation GetLineIndentation; from the public struct IDocumentVtable but it still appears.

      plugin_indentation.png

      PeterJonesP EkopalypseE 3 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Bas de Reuver
        last edited by

        @Bas-de-Reuver ,

        I had never thought of that as a consequence, but the app just looks at the full list of lexers – and it apparently treats the built-in lexers and the lexer-plugins as equivalent from that respect.

        I doubt there is currently a mechanism to have your lexer-plugin not be listed in that list. If no one else knows of a way to opt out, you might have to put in a feature request to provide such a mechanism to lexer plugins. (Since the app cannot see into your code, and thus wouldn’t know whether you have a the GetLineIndentation element or not, I don’t think that would be a way to implement your request. Maybe a message NPPM_LEXERPLUGIN_INDENT_OPTOUT or some such. If making such a request, check to see if there are other language lists that you want to be able to opt out of.)

        I have a feeling that if lexer plugins weren’t in that list, their authors would be asking that the ability to be in that list be added into Notepad++. It thus surprises me (1) that it already put lexer plugins in that list, and (2) that you don’t want to be in that list. Why not add the feature to CSV Lint to be able to use that GetLineIndentation, if at all possible? If CSV Lint were mine, I would at least try to make that work, before asking Don to let you opt out of the list; if you couldn’t make that work, I could understand asking for the feature, but if you can, then it’s a win-win. :-)

        1 Reply Last reply Reply Quote 4
        • EkopalypseE
          Ekopalypse @Bas de Reuver
          last edited by Ekopalypse

          @Bas-de-Reuver

          As @PeterJones already said, there is currently no way to escape this listing. To make this persistent for your user, one can currently use a workaround and simply make the changes in the CSVLint.xml.

          E.g.

          <Language name="VLang" ext="v" commentLine="//" commentStart="/*" commentEnd="*/" tabSettings="4" backspaceUnindent="no">
          

          You can find more information about here.

          Of course it would be nicer if this could also be done via the dialog, which in my opinion would also make the most sense if Npp did this itself. It already knows that this lexer exists and already has the code to do this for the built-in lexers.

          1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn
            last edited by

            Official issue opened: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16460

            1 Reply Last reply Reply Quote 4
            • EkopalypseE
              Ekopalypse @Bas de Reuver
              last edited by

              @Bas-de-Reuver

              Issue and PR made.

              1 Reply Last reply Reply Quote 3
              • Bas de ReuverB
                Bas de Reuver
                last edited by

                Nice, thanks for fixing the issue 👍

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors