SUMMARY When opening a file for editing in Kate, a hidden swap file with the extension .kate-swp is created in the same directory, for example: test.txt -> .test.txt.kate-swp This swap file appears to store unsaved changes in a binary format and is updated periodically. When the document is saved and closed normally, the corresponding .kate-swp file is removed as expected. However, for some time now, the following behavior can be observed: STEPS TO REPRODUCE 1. Open an existing file in Kate. 2. Make some changes to the file and wait a few seconds until kate-swp has been updated. 3. Close Kate or close the document. 4. In the dialog asking whether to save the changes, choose “Discard”. OBSERVED RESULT • The .kate-swp file is not removed. • When opening the same file again, Kate shows the message: “The file was not closed properly.” • The user is then asked to choose between: ◦ Show changes ◦ Recover file ◦ Discard EXPECTED RESULT If the user explicitly chooses “Discard” when closing the document, the swap file should be removed, just as it is when the document is saved and closed normally. In this case, the file was closed correctly — the user intentionally chose not to save the changes. Therefore: • No recovery prompt should appear on the next open. • The message “The file was not closed properly” is misleading in this situation. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.5.5 KDE Frameworks Version: 6.22.0 Qt Version: 6.10.1 Kernel Version: 6.18.5-arch1-1 (64-bit) ADDITIONAL INFORMATION The swap file mechanism makes sense to protect against crashes or unexpected termination, allowing recovery of unsaved work. However, when the user explicitly discards changes, the remaining .kate-swp file causes unnecessary and confusing recovery prompts, even though there was no crash or improper shutdown.
*** Bug 515346 has been marked as a duplicate of this bug. ***