Community
    • Login

    Save Plugin Button State

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 936 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors