diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index f528aa992..4ef9a5380 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -2217,6 +2217,7 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames) sessionExt += TEXT("."); sessionExt += ext; fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str(), NULL); + fDlg.setDefExt(ext); fDlg.setExtIndex(0); // 0 index for "custom extension types" } fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL); diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp index d6389147f..273f56a7c 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp @@ -267,6 +267,7 @@ TCHAR * FileDialog::doSaveDlg() NppParameters& params = NppParameters::getInstance(); _ofn.lpstrInitialDir = params.getWorkingDir(); + _ofn.lpstrDefExt = _defExt.c_str(); _ofn.Flags |= OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_ENABLESIZING; diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index 394381266..96ea4a0c9 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -49,6 +49,7 @@ public: int setExtsFilter(const TCHAR *extText, const TCHAR *exts); void setDefFileName(const TCHAR *fn){ wcscpy_s(_fileName, fn);} + void setDefExt(const TCHAR *ext){ _defExt = ext;} TCHAR * doSaveDlg(); stringVector * doOpenMultiFilesDlg(); @@ -63,6 +64,7 @@ protected : private: TCHAR _fileName[MAX_PATH*8]; + generic_string _defExt; TCHAR * _fileExt; int _nbCharFileExt; diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index f4f6508af..5faf0937e 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -1188,6 +1188,7 @@ void ProjectPanel::setFileExtFilter(FileDialog & fDlg) workspaceExt += TEXT("."); workspaceExt += ext; fDlg.setExtFilter(TEXT("Workspace file"), workspaceExt.c_str(), NULL); + fDlg.setDefExt(ext); } fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL); }