Skip to content

Commit bb15f67

Browse files
SimTheVoidSimLV
authored andcommitted
Remove old tabs on session load
1 parent 9184f1d commit bb15f67

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

doc/TODO.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/NotepadNext/SessionManager.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,19 @@ ScintillaNext *SessionManager::loadSession(MainWindow *window, QSettings &settin
287287
const int currentEditorIndex = settings.value("CurrentEditorIndex").toInt();
288288
const int size = settings.beginReadArray("OpenedFiles");
289289

290+
for (auto &editor : window->editors()) {
291+
if (editor->isFile()) {
292+
if (editor->isSavedToDisk()) {
293+
editor->close();
294+
}
295+
}
296+
else {
297+
if (!editor->modify()) {
298+
editor->close();
299+
}
300+
}
301+
}
302+
290303
// NOTE: In theory the fileTypes should determine what is loaded, however if the session fileTypes
291304
// change from the last time it was saved then it means the settings were manually altered outside of the app,
292305
// which is non-standard behavior, so just load anything in the file

0 commit comments

Comments
 (0)