Fix cloned (modified & unsaved) document disassociated issue after Npp being relaunched
The bug has been fixed in v8.5.7 by PR #14003. However the fix causes a regression #14164, the concerning commit is reverted. Hence this fix. Fix #10266, fix #10365pull/14455/head
parent
6f2e5d272c
commit
a51e62c16d
|
@ -2276,17 +2276,21 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch
|
|||
nppParam.safeWow64EnableWow64FsRedirection(FALSE);
|
||||
isWow64Off = true;
|
||||
}
|
||||
|
||||
if (PathFileExists(pFn))
|
||||
{
|
||||
if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT(""))
|
||||
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp);
|
||||
else
|
||||
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding);
|
||||
|
||||
//check if already open in main. If so, clone
|
||||
if (_mainDocTab.getIndexByBuffer(lastOpened) != -1)
|
||||
BufferID clonedBuf = _mainDocTab.findBufferByName(pFn);
|
||||
if (clonedBuf != BUFFER_INVALID)
|
||||
{
|
||||
loadBufferIntoView(lastOpened, SUB_VIEW);
|
||||
loadBufferIntoView(clonedBuf, SUB_VIEW);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT(""))
|
||||
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp);
|
||||
else
|
||||
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding);
|
||||
}
|
||||
}
|
||||
else if (isSnapshotMode && PathFileExists(session._subViewFiles[k]._backupFilePath.c_str()))
|
||||
|
@ -2299,6 +2303,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch
|
|||
if (foundBufID == BUFFER_INVALID)
|
||||
lastOpened = nppGUI._keepSessionAbsentFileEntries ? MainFileManager.newPlaceholderDocument(pFn, SUB_VIEW, userCreatedSessionName) : BUFFER_INVALID;
|
||||
}
|
||||
|
||||
if (isWow64Off)
|
||||
{
|
||||
nppParam.safeWow64EnableWow64FsRedirection(TRUE);
|
||||
|
|
Loading…
Reference in New Issue