@LhxVinCent said in Notepad++ is cleared after exiting abnormally.:
No backup files were found in the local backup directory.
Can you paste a screenshot of your Settings > Preferences > Backup page?
Because I am not sure exactly what you mean by “local backup directory”. The possibilities that I can think of:
If you mean the one in %AppData%\Notepad++\backup\ , that only holds the session-snapshot-and-periodic-backup saves (which are the temporary copies that happen every 7 seconds [by default] when you are between Ctrl+S/
File>Save; but as soon as you do a real save, that snapshot is deleted until you have more unsaved changes)
If you have the
Backup On Save preference set to Simple or Verbose:
and have defined the
Custom Backup Directory, then every time you use Ctrl+S/
File>Save, it should save a backup to that custom directory. If that’s not happening, that’s a problem (which is why I want to see your Backup preferences screenshot)
or instead have not enabled
Custom Backup Directory, then the simple backup-on-save will be in the same directory as your file, or the verbose backup-on-save will be in the .\nppBackup\ subdirectory relative to your active file’s directory. And again, it should update or save a new copy every time you hit Ctrl+S or
File>Save if this is your option setup.
For better understanding Notepad++'s various backup features in the future, you will want to read the User Manual section on the Backup Preferences (https://npp-user-manual.org/docs/preferences/#backup) as well as this Forum’s Backup FAQ
the tragedy was that the document that usually kept important records was emptied.I’ve been saving with Ctrl + S all the time during the editing process.
I was originally thinking you were just relying on “session snapshot and periodic backup”, but if you’ve been actively saving using Ctrl+S, that is reasonable behavior on your part.
As @Terry-R mentioned, v8.1.4 is pretty old at this point. Really old versions of Notepad++ used to have a bug where under certain unique Windows OS shutdown/crash conditions, a file being edited by Notepad++ would be saved as all NULL characters – you didn’t mention NULL, but maybe that’s what you are seeing. Over the last few years, Notepad++ has been drastically improved in that regard, but having a copy that’s 3.5 years old, that might be what has happened to you.
Using the techniques that @Almighty1 mentioned, or other file recovery software (the FAQ mentions a potential, though we cannot guarantee or warranty it), might help you recover your original files.
For the sake of your data going forward, I would highly recommend updating to v8.7.5 to get the last few years of bug fixes and improvements; and highly recommend reading and understanding the User Manual section and FAQ entry that I linked to earlier in this reply.