Community
    • Login

    Save Plugin Button State

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 462 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.
    • BlitzCoderB
      BlitzCoder
      last edited by BlitzCoder

      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

      rdipardoR 1 Reply Last reply Reply Quote 0
      • rdipardoR
        rdipardo @BlitzCoder
        last edited by

        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 the T[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.

        1 Reply Last reply Reply Quote 2
        • rdipardoR
          rdipardo
          last edited by

          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> -->
          
          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors