Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Save Plugin Button State

    Plugin Development
    2
    2
    103
    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.
    • BlitzCoder
      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

      R 1 Reply Last reply Reply Quote 0
      • R
        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
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors