mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Refine autosaving session on exit behaviour
Refine autosaving session on exit behaviour on only "Open session in a new instance" or "always in multi-Instance". If the "Default (mono-instance)" is chosen and the session is launched via command line with flag "-multiInst", the modified session won't be saved automatically. Fixes #11249, close #11255
This commit is contained in:
parent
3de15f5512
commit
e839b81e85
@ -6097,6 +6097,7 @@ std::vector<generic_string> Notepad_plus::loadCommandlineParams(const TCHAR * co
|
|||||||
return std::vector<generic_string>();
|
return std::vector<generic_string>();
|
||||||
|
|
||||||
NppParameters& nppParams = NppParameters::getInstance();
|
NppParameters& nppParams = NppParameters::getInstance();
|
||||||
|
const NppGUI& nppGUI = nppParams.getNppGUI();
|
||||||
FileNameStringSplitter fnss(commandLine);
|
FileNameStringSplitter fnss(commandLine);
|
||||||
|
|
||||||
// loading file as session file is allowed only when there is only one file
|
// loading file as session file is allowed only when there is only one file
|
||||||
@ -6108,6 +6109,7 @@ std::vector<generic_string> Notepad_plus::loadCommandlineParams(const TCHAR * co
|
|||||||
const bool isSnapshotMode = false;
|
const bool isSnapshotMode = false;
|
||||||
const bool shouldLoadFileBrowser = true;
|
const bool shouldLoadFileBrowser = true;
|
||||||
|
|
||||||
|
if ((nppGUI._multiInstSetting == multiInstOnSession) || (nppGUI._multiInstSetting == multiInst))
|
||||||
nppParams.setLoadedSessionFilePath(fnss.getFileName(0));
|
nppParams.setLoadedSessionFilePath(fnss.getFileName(0));
|
||||||
loadSession(session2Load, isSnapshotMode, shouldLoadFileBrowser);
|
loadSession(session2Load, isSnapshotMode, shouldLoadFileBrowser);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user