diff --git a/doc/TODO.md b/doc/TODO.md deleted file mode 100644 index 705351dc0..000000000 --- a/doc/TODO.md +++ /dev/null @@ -1,22 +0,0 @@ -## TODO - - - Sessions - - [v] Save/Load sessions - - [ ] Remove old tabs on session load - - [v] Store Bookmarks - - [ ] Store per session settings - - - Editor - - [ ] Auto Tabs/Spaces - - [ ] Temp views from commands - - [ ] Log streams - - [ ] Support for Language Server Protocol - - - Workspace dock - - [ ] New File - - [ ] New Folder - - [ ] Locate current editor inside tree - - - Other - - [ ] On Save Hooks to Lua (linters etc) - - [ ] Run command diff --git a/src/NotepadNext/SessionManager.cpp b/src/NotepadNext/SessionManager.cpp index f349262b5..125625159 100644 --- a/src/NotepadNext/SessionManager.cpp +++ b/src/NotepadNext/SessionManager.cpp @@ -287,6 +287,19 @@ ScintillaNext *SessionManager::loadSession(MainWindow *window, QSettings &settin const int currentEditorIndex = settings.value("CurrentEditorIndex").toInt(); const int size = settings.beginReadArray("OpenedFiles"); + for (auto &editor : window->editors()) { + if (editor->isFile()) { + if (editor->isSavedToDisk()) { + editor->close(); + } + } + else { + if (!editor->modify()) { + editor->close(); + } + } + } + // NOTE: In theory the fileTypes should determine what is loaded, however if the session fileTypes // change from the last time it was saved then it means the settings were manually altered outside of the app, // which is non-standard behavior, so just load anything in the file