Session recovery
I am running the very latest pre-release of Windows 10, and, as such, it can become unstable at times as it did today when...
Steps to describe and reproduce the issue
- I had opened up Notepad++, which loaded my previous session, as expected. I had about 10 tabs in that session. 9 of those where new unsaved tabs, i.e., never linked to a physical file.
- I created a new tab and typed up some notes and left Notepad++ running.
- Soon afterwards Windows froze up and I had to power off, i.e., not perform a proper shutdown.
- After I rebooted and ran up Notepad++, my session was blank.
- I then went to the backup folder under my profile and restored the files from there.
- However, when I then tried to close Notepad++, it warned me that I would lose my files.
- I realised it didin't like me linking to files in the backup folder, so I copied all the files elsewhere before closing down Notepad++.
- I ensure the backup folder was clear of files.
- I then opened these files with Notepad++ and now I could close Notepad++ without it warning me.
Expected/suggested behaviour
I suggest that, if Notepad++ starts up and the previous session is empty but there are files in the backup folder that match the naming convention of Notepad++ backup files, then Notepad++ should detect this state and ask the user if they would like to recover the session warning the user that if they don't that the backup files will be erased. If the user then says yes, those files are opened up into new tabs that are not linked to files on the system and using the name of the backup files less the appended date-stamp for the tab names. The backup files then are wiped allowing Notepad++ to manage the opened tabs in the usual manner. If the user instead says no to the prompt about recovering the last session, then the backup files are simply erased, but only those that match the naming convention of Notepad++ backup files.
See related issue: #2381.
Debug information
Notepad++ 7.5.6 32-bit
Fix by https://github.com/notepad-plus-plus/notepad-plus-plus/commit/6000f3bb21a42a4d28d068617e0dc642ef739b26