Browse Source

Fix NPPM_RELOADFILE API return wrong result issue

Now NPPM_RELOADFILE returns the correct value: TRUE if reloading file succeeds, otherwise FALSE.

Ref: https://community.notepad-plus-plus.org/topic/25533/nppm_reloadfile-should-return-true-_only_-on-success/4
pull/14830/head
Don Ho 9 months ago
parent
commit
060396c698
  1. 2
      PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
  2. 2
      PowerEditor/src/NppBigSwitch.cpp

2
PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h

@ -288,7 +288,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Reload the document which matches with the given filePathName2switch.
// wParam: 0 (not used)
// lParam[in]: filePathName2Reload is the full file path of document to reload
// Return TRUE
// Return TRUE if reloading file succeeds, otherwise FALSE
#define NPPM_SWITCHTOFILE (NPPMSG + 37)
// BOOL NPPM_SWITCHTOFILE(0, TCHAR* filePathName2switch)

2
PowerEditor/src/NppBigSwitch.cpp

@ -682,7 +682,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
BufferID id = MainFileManager.getBufferFromName(longNameFullpath);
if (id != BUFFER_INVALID)
doReload(id, wParam != 0);
result = doReload(id, wParam != 0);
break; // For relaying this message to other plugin by calling "_pluginsManager.relayNppMessages(message, wParam, lParam)" at the end.
}

Loading…
Cancel
Save