Community
    • Login

    Support for Plugins Admin & NppPluginList

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    45 Posts 26 Posters 54.4k 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.
    • Stan Mitchell130S
      Stan Mitchell130
      last edited by

      **Problem Installing Style.xml for Plugin External Lexers **

      I’m using the recommended procedure for testing my plugin: Npp 7.6.1, gup debug. After modifying nppPluginList.json, my distribution zip is found and the files are extracted and installed. My lexer plugin depends on an xml file for syntax styling that should be in the user directory under %APPDATA%\Notepad++\plugins\config but it is not getting copied there. With the old plugin manager, some rules were supplied for where things were to be copied on installation. How should that kind of thing be handled now with the new Plugin Admin?

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

        I’m running into the same problem as @Stan-Mitchell130 's GEDCOM plug-in with my CSV Lint plugin. The plug-in provides a custom lex() function which requires an .XML file for the syntax highlighting colors. When installing the plug-in this XML file should be placed in the user’s \config\ folder, like so:

        CSVLint.dll ----> C:\Program Files\Notepad++\plugins\CSVLint\CSVLint.dll
        CSVLint.xml —> %USERPROFILE%\AppData\Roaming\Notepad++\plugins\config\CSVLint.xml

        I’ve added the installation .zip files (both 32bit and 64bit) to the Plugins Admin list and the .zip files contains just the two files, like so:

        CSVLint.zip

        • CSVLint.dll
        • CSVLint.xml

        But this places the CSVLint.xml file in the same folder as the Program Files\Notepad++\plugins\CSVLint\ folder, so this is incorrect. After you install the plug-in and start Notepad++ wil give an error “\plugins\Config\CSVLint.xml is missing. CSVLint.dll is not compatible… etc.”

        I noticed that the GedcomLexer also provides an XML file but it’s placed in a subfolder in the .zip called “Config”. However, this still causes the GedcomLexer.xml file to be copied to the incorrect folder Program Files\Notepad++\plugins\GedcomLexer\Config\GedcomLexer.xml, so that gives the same problem.

        GedcomLexer.zip

        • GedcomLexer.dll
        • Config\GedcomLexer.xml
        • etc. more files

        So my question is, how should I provide the .XML file in the .zip file, in such a way that the Plugins Admin will copy it to the correct .\config\ folder?

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

          @Bas-de-Reuver

          I am not sure if this is the best way.
          From the plugin’s point of view, it is necessary that this file exists.
          What if it was accidentally deleted?

          What I do is check the existence of the file in the setInfo callback and create it if necessary.

          fn set_info(nppData NppData) {
          	npp_data = nppData
          	notepad = npp.Npp{npp_data.npp_handle}
          	editor = sci.create_editors(nppData.scintilla_main_handle, nppData.scintilla_second_handle)
          
          	// create language xml in plugin config directory if needed
          	config_dir := notepad.get_plugin_config_dir()
          	lang_xml := os.join_path(config_dir, language_name+'.xml')
          	if !os.exists(lang_xml) {
          		if !create_lang_xml(lang_xml) {
          			msg := 'Unable to create VLang xml file\n$lang_xml'
          			message_box(npp_data.npp_handle, msg, 'Error', u32(C.MB_OK | C.MB_ICONERROR))
          		}
          	}
          }
          
          1 Reply Last reply Reply Quote 3
          • Bas de ReuverB
            Bas de Reuver
            last edited by

            @Ekopalypse You mean when it’s not found then generate the default XML file on the fly? So the plug-in .DLL will include a hard-coded default XML file including all the default color settings.

            I find it a bit counter-intuitive to include a configuration/settings file as hard-coded, but on the other hand I agree that in this case it is more practical for the end-user. Okay thanks for the tip, I’ll look into that.

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

              @Bas-de-Reuver

              yes, you have to have one anyway.

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

                Okay I’ve fixed the issue, see code here, and I’ll prepare a new release.

                One important thing here is that if you write the lexer xml file, it has to be UTF-8 encoded (so without BOM). If you write it UTF-8-BOM encoded then Notepad++ won’t read it, even though it also won’t give the “xml is missing” error anymore.

                1 Reply Last reply Reply Quote 3
                • datherton15D
                  datherton15
                  last edited by

                  Apologies if this is in the wrong spot…
                  Having issues with the XML Tools plugin crashing when trying to “pretty print” the the xml is missing a single closing bracket on the last tag (it was a bad cut-paste). It consistently happened as I’m poor at cut-paste :oP.
                  Thanks for any assistance in passing this forward to the appropriate devs…
                  DA

                  PeterJonesP 1 Reply Last reply Reply Quote 0
                  • PeterJonesP
                    PeterJones @datherton15
                    last edited by

                    @datherton15 said in Support for Plugins Admin & NppPluginList - Round 2:

                    Apologies if this is in the wrong spot…

                    It is the wrong spot. This Topic is specifically about the Plugins Admin tool inside Notepad++, not for general questions about any plugin.

                    It would be better to ask it as a New Topic in the Plugin Development or Help Wanted sections.

                    Thanks for any assistance in passing this forward to the appropriate devs…

                    The Plugins > XML Tools > About contains a link to the repository for XML Tools development. From that site, you can go to the “Issues” page, and can create an issue directly with the XML Tools developer.

                    datherton15D 1 Reply Last reply Reply Quote 0
                    • Bas de ReuverB Bas de Reuver referenced this topic on
                    • Bas de ReuverB Bas de Reuver referenced this topic on
                    • datherton15D
                      datherton15 @PeterJones
                      last edited by

                      @peterjones
                      Thanks and appreciate the directions.
                      Dave

                      1 Reply Last reply Reply Quote 0
                      • lifehack nerdL
                        lifehack nerd
                        last edited by

                        Hello,

                        I am a new developer for several days. I make my own plug based on the ‘Npp Converter’.
                        But I am confused about the separation lines in the menu.
                        Could anyone tell me how can I remove them? It seems a simple question but I still can’t figure out how to customiz it.

                        Thanks!

                        The separation lines in the red box:
                        1645712633163-img.png

                        this is the code:

                        void commandMenuInit()
                        {
                            //setCommand(1, TEXT("HEX -> ASCII"), hex2Ascii, NULL, false);
                        	//setCommand(2, TEXT("---"), NULL, NULL, false);
                        	//setCommand(CONVERSIONPANEL_INDEX, TEXT("Conversion Panel"), conversionPanel, NULL, false);
                        	//setCommand(4, TEXT("---"), NULL, NULL, false);
                        	//setCommand(5, TEXT("Edit Configuration File"), editConf, NULL, false);
                        	//setCommand(6, TEXT("About"), about, NULL, false);
                        
                        	setCommand(0, TEXT("Filter1"), filterRun1, NULL, false);
                        	setCommand(1, TEXT("Filter2"), filterRun2, NULL, false);
                        	setCommand(2, TEXT("Filter3"), filterRun3, NULL, false);
                        	setCommand(3, TEXT("Edit Configuration"), conversionPanel, NULL, false);
                        	setCommand(4, TEXT("About"), about, NULL, false);
                        }
                        
                        EkopalypseE 1 Reply Last reply Reply Quote 0
                        • EkopalypseE
                          Ekopalypse @lifehack nerd
                          last edited by

                          @lifehack-nerd

                          Please avoid posting the same question multiple times.

                          lifehack nerdL 1 Reply Last reply Reply Quote 0
                          • lifehack nerdL
                            lifehack nerd @Ekopalypse
                            last edited by

                            @ekopalypse Got it. I won’t any more.

                            1 Reply Last reply Reply Quote 0
                            • donhoD donho unpinned this topic on
                            • M
                              mh-tp
                              last edited by

                              Question: How do I update my local NppPluginList? I find a NppPluginList in C:\Program Files\Notepad++\plugins\Config\nppPluginList.dll
                              version is 1.7.8

                              and the releases on github only offer the source code, but no compiled NppPluginList…

                              Answer: I just downloaded the 8.7.8 installer of Notepad++ and the NppPluginList got updated too. Confusing was the “no update available…” The text and the … is very small, but contains important information about the update releases, so you’ll end up ccleaner or plugins tell you npp isn’t up to date, while it self tells you it is…

                              (I’m not sure if this is the right thread to ask)

                              PeterJonesP 1 Reply Last reply Reply Quote 0
                              • PeterJonesP
                                PeterJones @mh-tp
                                last edited by

                                @mh-tp said in Support for Plugins Admin & NppPluginList:

                                Answer: I just downloaded the 8.7.8 installer of Notepad++ and the NppPluginList got updated too.

                                Or download the most-recent portable copy, where you can get the DLL without having to upgrade the rest, if you don’t want to.

                                Confusing was the “no update available…”

                                See our “most recent version” FAQ and the User Manual page on Upgrading Notepad++

                                The text and the … is very small, but contains important information about the update releases, so you’ll end up ccleaner or plugins tell you npp isn’t up to date, while it self tells you it is…

                                I don’t see how the size of the text has anything to do with what cleaner tells you (but after years of CCleaner getting worse and worse, I gave up ever listening to what it told me, and uninstalled it ages ago)

                                1 Reply Last reply Reply Quote 0
                                • bombitupB
                                  bombitup Banned
                                  last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • bombitupB
                                    bombitup Banned @DataCrypt
                                    last edited by

                                    This post is deleted!
                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post
                                    The Community of users of the Notepad++ text editor.
                                    Powered by NodeBB | Contributors