Automatic file extensions for session/workspace while opening

Close #8317
This commit is contained in:
Udo Hoffmann 2020-05-26 16:06:26 +02:00 committed by Don HO
parent e9e9e8daa9
commit aba75b5643
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 2 additions and 0 deletions

View File

@ -2121,6 +2121,7 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn)
sessionExt += TEXT(".");
sessionExt += ext;
fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str(), NULL);
fDlg.setDefExt(ext);
}
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
sessionFileName = fDlg.doOpenSingleFileDlg();

View File

@ -164,6 +164,7 @@ TCHAR* FileDialog::doOpenSingleFileDlg()
::GetCurrentDirectory(MAX_PATH, dir);
NppParameters& params = NppParameters::getInstance();
_ofn.lpstrInitialDir = params.getWorkingDir();
_ofn.lpstrDefExt = _defExt.c_str();
_ofn.Flags |= OFN_FILEMUSTEXIST;