Afaik new documents are purely saved in RAM. Only when they are stored in a location, the live changes are stored in a tempfile in the same dir. What happens: I created a new file and didnt save it yet. Set the Laptop to sleep, after wakeup kscreenlock crashed, again, and I needed to force shutdown. the writing was lost on reboot, no restore dialog as there was no tempfile. What should happen: Always create a tempfile in the KDE config dir or somewhere else. Maybe in Home, and add it to a .hidden file or simply add a dot. This tempfile will then allow restoring any previous document, not only if a saved one has a tempfile in the same dir with some detected diffs. This is crucial for Kates crash resistance. May have problems in the Flatpak due to portals, so saving in a Kate-specific config dir should be better to avoid any external storage write access
Is a good idea and a valid wish, help to implement that is welcome.
Duplicate of bug 274102?