Support for Plugins Admin & NppPluginList
-
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.xmlI’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 theProgram 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 folderProgram 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? -
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)) } } }
-
@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.
-
yes, you have to have one anyway.
-
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.
-
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 -
@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.
-
-
-
@peterjones
Thanks and appreciate the directions.
Dave -
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:
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); }
-
Please avoid posting the same question multiple times.
-
@ekopalypse Got it. I won’t any more.
-