Browse Source

Add session.xml.fail2Load for analyzing

When session.xml is written while Notepad++ exit, it'll be load for checking if it's an valid xml file.
If not, then it will be replaced by the old session file (if any).

This commit renames session.xml to session.xml.fail2Load so in case of the situation user can provide session.xml.fail2Load to devs for analyzing.

Ref #13694

Close #13741
pull/13751/head
Don Ho 1 year ago
parent
commit
ccf80a0699
  1. 4
      PowerEditor/src/Parameters.cpp

4
PowerEditor/src/Parameters.cpp

@ -3596,6 +3596,10 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
TEXT("The old session file will be restored."),
TEXT("Error of saving session file"),
MB_OK | MB_APPLMODAL | MB_ICONWARNING);
wstring sessionPathNameFail2Load = sessionPathName;
sessionPathNameFail2Load += L".fail2Load";
MoveFileEx(sessionPathName, sessionPathNameFail2Load.c_str(), MOVEFILE_REPLACE_EXISTING);
CopyFile(backupPathName, sessionPathName, FALSE);
}
}

Loading…
Cancel
Save