mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
no need to save current file (doc changed) for open new (empty) np3 window
This commit is contained in:
parent
0578281ee5
commit
6835a69555
@ -4826,9 +4826,9 @@ void RestorePrevScreenPos(HWND hwnd)
|
||||
//
|
||||
// DialogNewWindow()
|
||||
//
|
||||
void DialogNewWindow(HWND hwnd, bool bSaveOnRunTools, const HPATHL hFilePath, WININFO* wi)
|
||||
void DialogNewWindow(HWND hwnd, bool bSaveBeforeOpen, const HPATHL hFilePath, WININFO* wi)
|
||||
{
|
||||
if (bSaveOnRunTools && !FileSave(FSF_Ask)) {
|
||||
if (bSaveBeforeOpen && !FileSave(FSF_Ask)) {
|
||||
return;
|
||||
}
|
||||
WCHAR wch[80] = { L'\0' };
|
||||
|
||||
@ -77,7 +77,7 @@ WINDOWPLACEMENT WindowPlacementFromInfo(HWND hwnd, const WININFO* pWinInfo, SCRE
|
||||
void SnapToWinInfoPos(HWND hwnd, const WININFO winInfo, SCREEN_MODE mode, UINT nCmdShow);
|
||||
void RestorePrevScreenPos(HWND hwnd);
|
||||
|
||||
void DialogNewWindow(HWND hwnd, bool bSaveOnRunTools, const HPATHL hFilePath, WININFO* wi);
|
||||
void DialogNewWindow(HWND hwnd, bool bSaveBeforeOpen, const HPATHL hFilePath, WININFO* wi);
|
||||
void DialogFileBrowse(HWND hwnd);
|
||||
void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern);
|
||||
void DialogAdminExe(HWND hwnd,bool);
|
||||
|
||||
@ -3684,8 +3684,9 @@ static LRESULT _OnDropOneFile(HWND hwnd, HPATHL hFilePath, WININFO* wi)
|
||||
}
|
||||
else if (Path_IsExistingFile(hFilePath)) {
|
||||
//~ ignore Flags.bReuseWindow
|
||||
bool const sameFile = (Path_StrgComparePath(hFilePath, Paths.CurrentFile, Paths.ModuleDirectory) == 0);
|
||||
if (IsKeyDown(VK_CONTROL) || wi) {
|
||||
DialogNewWindow(hwnd, Settings.SaveBeforeRunningTools, hFilePath, wi);
|
||||
DialogNewWindow(hwnd, sameFile, hFilePath, wi);
|
||||
} else {
|
||||
FileLoad(hFilePath, fLoadFlags, 0, 0);
|
||||
}
|
||||
@ -4840,7 +4841,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_FILE_NEWWINDOW2: {
|
||||
SaveAllSettings(false);
|
||||
HPATHL hpth = (iLoWParam == IDM_FILE_NEWWINDOW2) ? Paths.CurrentFile : NULL;
|
||||
DialogNewWindow(hwnd, Settings.SaveBeforeRunningTools, hpth, NULL);
|
||||
DialogNewWindow(hwnd, (hpth != NULL), hpth, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -12117,7 +12118,7 @@ bool FileSave(FileSaveFlags fSaveFlags)
|
||||
LONG const answer = InfoBoxLng(typ, L"ReloadExSavedCfg", IDS_MUI_RELOADSETTINGS, tch);
|
||||
if (IsYesOkay(answer)) {
|
||||
///~SaveAllSettings(true); ~ already saved (CurrentFile)
|
||||
DialogNewWindow(Globals.hwndMain, false, Paths.CurrentFile, NULL);
|
||||
DialogNewWindow(Globals.hwndMain, true, Paths.CurrentFile, NULL);
|
||||
CloseApplication();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user