Skip to content

Commit

Permalink
Merge branch 'npp_official_svn' into jl/LH-45/integrate-npp-svn
Browse files Browse the repository at this point in the history
[NEW] Add NPPM_SAVECURRENTFILEAS message.

Conflicts:
	PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h

[#45]

Signed-off-by: Jocelyn Legault <jocelynlegault@gmail.com>
  • Loading branch information
joce committed Oct 4, 2010
2 parents f76d366 + 356d582 commit 803bde1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
//BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch)

#define NPPM_SAVECURRENTFILE (NPPMSG + 38)
//NPPM_SAVECURRENTFILE(0, 0)
//BOOL NPPM_SAVECURRENTFILE(0, 0)

#define NPPM_SAVEALLFILES (NPPMSG + 39)
//BOOL NPPM_SAVEALLFILES(0, 0)
Expand Down Expand Up @@ -305,6 +305,9 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
// 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)
Expand Down
10 changes: 10 additions & 0 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,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();
Expand Down

0 comments on commit 803bde1

Please sign in to comment.