Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NppTbData.pszModuleName is not properly assigned when Markdown panel is docked #90

Open
rdipardo opened this issue Oct 29, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@rdipardo
Copy link
Contributor

A forum user asked a while ago why N++'s built-in Docking Manager never reloads the MarkdownViewer++ panel when the application starts. This goes for NppMarkdownPanel as well, and for the same reason, so I'm cross-posting nea/MarkdownViewerPlusPlus#159.

The problem is the plugin's module name is serialized without a file extension. N++ fails to locate the module on disk, so never calls NppMarkdownPanel.MarkdownPanelController.TogglePanelVisible() when starting up.

See what happens when the file extension is written to config.xml as the TogglePanelVisible method should be doing.

  1. Click Toggle Markdown Panel and leave the panel showing
  2. Quit Notepad++
  3. Open %AppData%\Notepad++\config.xml (if you have a system-wide installation), or the config.xml inside your portable installation
  4. Notice that NppMarkdownPanel.Main.ModuleName is the value of the pluginName attribute, e.g.,
<GUIConfig name="DockingManager" leftWidth="200" rightWidth="664" topHeight="200" bottomHeight="200">
    <PluginDlg pluginName="NppMarkdownPanel" id="0" curr="1" prev="-1" isVisible="yes" />
    <!-- . . . -->
</GUIConfig>
  1. Edit the XML to pluginName="NppMarkdownPanel.dll", i.e., append the module's file extension; make sure isVisible remains "yes"
  2. Start Notepad++
  3. The panel is automatically opened

A tiny patch is all that's needed to make this the default behaviour:

--- a/NppMarkdownPanel/MarkdownPanelController.cs
+++ b/NppMarkdownPanel/MarkdownPanelController.cs
@@ -298 +298 @@ namespace NppMarkdownPanel
-                _nppTbData.pszModuleName = Main.ModuleName;
+                _nppTbData.pszModuleName = $"{Main.ModuleName}.dll";
vinsworldcom pushed a commit to vinsworldcom/NppMarkdownPanel that referenced this issue Nov 2, 2023
vinsworldcom pushed a commit to vinsworldcom/NppMarkdownPanel that referenced this issue Nov 2, 2023
Fix mohzy83#90 , thanks @rdipardo !

Merge branch 'develop'
@mohzy83 mohzy83 added the bug Something isn't working label Dec 5, 2023
@mohzy83 mohzy83 added this to the 0.7.4 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants