Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit fbc710d

Browse files
committed
Fixed GetCurrentFilePath due to unexpected return value
1 parent 7caa5b8 commit fbc710d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Visual Studio Project Template C#/PluginInfrastructure/NotepadPPGateway.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ public void AddToolbarIcon(int funcItemsIndex, Bitmap icon)
6060
/// Gets the path of the current document.
6161
/// </summary>
6262
public string GetCurrentFilePath()
63-
=> GetString(NppMsg.NPPM_GETFULLCURRENTPATH);
63+
{
64+
var path = new StringBuilder(2000);
65+
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLCURRENTPATH, 0, path);
66+
return path.ToString();
67+
}
6468

6569
/// <summary>
6670
/// This method incapsulates a common pattern in the Notepad++ API: when

0 commit comments

Comments
 (0)