From 1953eea074dfb6ed1d5cca031ce591a411841d71 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 24 May 2010 18:51:50 +0000 Subject: [PATCH] [NEW] Add NPPM_SAVECURRENTFILEAS message. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@634 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/MISC/PluginsManager/Notepad_plus_msgs.h | 5 ++++- PowerEditor/src/NppBigSwitch.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 96523029..67d68750 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -122,7 +122,7 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) #define NPPM_SAVECURRENTFILE (NPPMSG + 38) - //BOOL WM_SWITCHTOFILE(0, 0) + //BOOL NPPM_SAVECURRENTFILE(0, 0) #define NPPM_SAVEALLFILES (NPPMSG + 39) //BOOL NPPM_SAVEALLFILES(0, 0) @@ -308,6 +308,9 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // fullPathName2Open indicates the full file path name to be opened. // The return value is TRUE (1) if the operation is successful, otherwise FALSE (0). + #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78) + // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename) + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 1853d104..d7d045c6 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -356,6 +356,16 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa } break; + case NPPM_SAVECURRENTFILEAS: + { + BufferID currentBufferID = _pEditView->getCurrentBufferID(); + bool asCopy = wParam == TRUE; + const TCHAR *filename = (const TCHAR *)lParam; + if (!filename) return FALSE; + return doSave(currentBufferID, filename, asCopy); + } + break; + case NPPM_SAVEALLFILES: { return fileSaveAll();