Skip to content

Commit

Permalink
Fix NPPM_RELOADFILE API return wrong result issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
donho committed Mar 4, 2024
1 parent 2adf712 commit 060396c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down

0 comments on commit 060396c

Please sign in to comment.