From c79f105597ef69b980e79fb02de766ac7c8dd151 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 3 Apr 2014 23:46:21 +0000 Subject: [PATCH] [NEW_FEATURE] Automatic Backup System (in progress). git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1214 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 4 ++++ PowerEditor/src/NppBigSwitch.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 59dabbe7..228cc192 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4270,10 +4270,14 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session, bool includUntitledD Buffer * buf = MainFileManager->getBufferByID(bufID); + if (buf->isUntitled() && buf->docLength() == 0) + continue; + if (!includUntitledDoc) if (!PathFileExists(buf->getFullPathName())) continue; + generic_string languageName = getLangFromMenu(buf); const TCHAR *langName = languageName.c_str(); sessionFileInfo sfi(buf->getFullPathName(), langName, buf->getEncoding(), buf->getPosition(editView), buf->getBackupFileName().c_str(), int(buf->getLastModifiedTimestamp())); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index ad1329ed..fb118f28 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1402,7 +1402,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa Session currentSession; if (nppgui._rememberLastSession) { - getCurrentOpenedFiles(currentSession); + getCurrentOpenedFiles(currentSession, true); //Lock the recent file list so it isnt populated with opened files //Causing them to show on restart even though they are loaded by session _lastRecentFileList.setLock(true); //only lock when the session is remembered