Save Plugin Button State
-
It would be nice to preserve the session or state of a button, if a plugin has a tool button placed on the menu.
Ideally where you always open notepad++ and the word wrap or indent guide are still on the same state where you left it off last.
Example or topic related to this request:
https://community.notepad-plus-plus.org/topic/23221/toggle-markdown-viewer-plugin-on-startup?_=1658173295100 -
Plugins can persist the state of docked panels with the
NPPM_DMMREGASDCKDLG
API (available since Notepad++ 4.0, according to the documentation).It isn’t obvious to a non-technical user, but it’s really the plugin’s job to call the API. The editor just handles the call by saving the panel’s coordinates and visibility to
%AppData%\config.xml
, as illustrated in my post to the original thread.It wouldn’t be practical for N++ to automatically register every loaded plugin like this. To begin with, not every plugin provides a panel. The ones that do provide them are responsible for marshalling their own data. The so-called “button state” of a docked panel is exactly what the
tTbData
structure is designed to serialize: the state of theT
[ool]b
[ar] where the plugin puts its icon.Basically, what you’re asking for is already a long-standing feature. If a certain plugin is not using it (or using it wrongly), that’s an issue for the plugin’s maintainer to resolve.
-
I said in Save Plugin Button State:
If a certain plugin is not using it (or using it wrongly), that’s an issue for the plugin’s maintainer to resolve.
The bug report is here, finally: https://github.com/nea/MarkdownViewerPlusPlus/issues/159
In the meantime, just putting
.dll
after the plugin name will get it working, e.g.,<!-- <GUIConfig name="DockingManager" ... > --> <PluginDlg pluginName="MarkdownViewer++.dll" id="0" curr="1" prev="-1" isVisible="yes" /> <!-- </GUIConfig> -->