-
Notifications
You must be signed in to change notification settings - Fork 37
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
Plugin release v0.7.2 searches help files in wrong directory #76
Comments
The installation folder depends on the JSON manifest bundled with Plugins Admin, so this issue really belongs here. The help file path is built from the
|
I don't agree. The plugin's DLL name is I guess the bug derives from recent renaming of the plugin's menu entry from |
I stand corrected. It seems that 9872e9f just changed the value of an internal class member. To really keep the help file path in sync, you would have to extract the directory name from the assembly's binary file information; something like this: diff --git a/NppMarkdownPanel/MarkdownPanelController.cs b/NppMarkdownPanel/MarkdownPanelController.cs
index 5e37268..57c600f 100644
--- a/NppMarkdownPanel/MarkdownPanelController.cs
+++ b/NppMarkdownPanel/MarkdownPanelController.cs
@@ -8,6 +8,7 @@ using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
+using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -209,9 +210,12 @@ namespace NppMarkdownPanel
private void ShowHelp()
{
+ var dll = (typeof(Main)).Assembly;
+ var dllVersionInfo = FileVersionInfo.GetVersionInfo(dll.Location);
+ string dllDir = Path.GetFileNameWithoutExtension(dllVersionInfo.OriginalFilename);
StringBuilder sbPluginPath = new StringBuilder(Win32.MAX_PATH);
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETPLUGINHOMEPATH, Win32.MAX_PATH, sbPluginPath);
- var helpFile = Path.Combine($"{sbPluginPath}", Main.PluginName, "README.md");
+ var helpFile = Path.Combine($"{sbPluginPath}", dllDir, "README.md");
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DOOPEN, 0, helpFile);
if (!isPanelVisible)
TogglePanelVisible();
|
Like @rdipardo said, the const |
fixed in version 0.7.3. @dinkumoil please verify. Thanks. |
Confirmed. |
Description
Release v0.7.2 of the plugin searches help files in folder
<Npp-folder>\plugins\MarkdownPanel
instead of<Npp-folder>\plugins\NppMarkdownPanel
.Steps to Reproduce
(menu) Plugins -> MarkdownPanel
and click on menu itemHelp
.<Npp-folder>\plugins\MarkdownPanel
and moving folderhelp
and fileREADME.md
from folder<Npp-folder>\plugins\NppMarkdownPanel
to the new folder, help file is shown in Notepad++The text was updated successfully, but these errors were encountered: