From a449c5e8042b46a7ccabfe374f5d68f20c682a33 Mon Sep 17 00:00:00 2001 From: xomx Date: Thu, 17 Apr 2025 21:55:28 +0200 Subject: [PATCH] Fix breaking of the cloned file status after Notepad++ restart Fix #16412, close #16440 --- PowerEditor/src/NppIO.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 6020b29b0..fb7ded1bc 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -2552,7 +2552,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch isWow64Off = true; } #endif - if (doesFileExist(pFn)) + if (doesFileExist(pFn) || (isSnapshotMode && doesFileExist(session._subViewFiles[k]._backupFilePath.c_str()))) { //check if already open in main. If so, clone BufferID clonedBuf = _mainDocTab.findBufferByName(pFn); @@ -2569,10 +2569,6 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding); } } - else if (isSnapshotMode && doesFileExist(session._subViewFiles[k]._backupFilePath.c_str())) - { - lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp); - } else { BufferID foundBufID = MainFileManager.getBufferFromName(pFn);