Comments (7)
The plugin's DLL name is
NppMarkdownPanel.dll
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();
from nppmarkdownpanel.
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 PluginName
field; it's always in sync with the compiled assembly:
from nppmarkdownpanel.
this issue really belongs here.
I don't agree. The plugin's DLL name is NppMarkdownPanel.dll
, thus the folder it is stored into must be <Npp-folder>\plugins\NppMarkdownPanel
. This should also be the folder where plugin's companion files and folders are stored. It seems like function Main.PluginName
returns the string MarkdownPanel
instead of NppMarkdownPanel
, so the plugin searches its help files in the wrong folder.
I guess the bug derives from recent renaming of the plugin's menu entry from NppMarkdownPanel
to MarkdownPanel
in commit 9872e9f. When installing a plugin, PluginAdmin generates the target folder name from the name of the DLL file it finds at the root level of the plugin's ZIP package, not from the return value of plugin interface's function getName
, simply because the plugin is not (and can not be) loaded during its installation, so this function cannot be called.
from nppmarkdownpanel.
Like @rdipardo said, the const Main.PluginName
is used to construct the path to the help file.
It's much safer to use the directory of the executing assembly and dont rely on that constant.
I will change the implementation accordingly.
from nppmarkdownpanel.
fixed in version 0.7.3. @dinkumoil please verify. Thanks.
from nppmarkdownpanel.
It works.
from nppmarkdownpanel.
It works.
Confirmed.
from nppmarkdownpanel.
Related Issues (20)
- [Feature Request] Is it possible to add Markdeep to the viewer? HOT 3
- [Future request] The MarkdownViewer++ does not render the latex equation HOT 2
- [Feature Request] Pandoc post-processing via Save As... HOT 1
- Table of Contents (TOC) option HOT 1
- Local relative path not working with img tag HOT 2
- Error on execution in Markdown Panel. HOT 1
- Feature Request: Links whitin the same document HOT 2
- Auto update Markdownviewer preview panel not working anymore HOT 4
- Dark-mode .css anchor color is ignored when rendered in Notepad++ but displayed correctly in exported HTML
- Unable to display special characters HOT 4
- `NppTbData.pszModuleName` is not properly assigned when Markdown panel is docked
- The keyboard shortcuts are not working on the Markdown Panel. HOT 1
- Deprecated...
- Deprecated...
- Proposal - ID as combination of tag name and id number HOT 1
- Local images preview has dont work HOT 1
- preview scroll position is not preserved when switching to another file then back to markdown file
- Undocking the viewer from its default position crashes NotePad++
- Always render fenced code blocks (solved) HOT 3
- Limiting to particular file extensions is too limiting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nppmarkdownpanel.