SUMMARY Since at least the update to version 23.04.2, ghostwriter appears to delete user files when saving them with a new name. I have witnessed this behaviour when saving a file with a new name: the old file is deleted from the disk. It is not even moved to the recycling bin, it is simply removed altogether. This means the user can, and will, lose their data. STEPS TO REPRODUCE 1. Open a file. 2. Save it with a new name in a different directory. OBSERVED RESULT The file you opened is deleted. EXPECTED RESULT The file you opened is left intact. SOFTWARE/OS VERSIONS Linux: KDE neon KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.107.0 Qt Version: 5.15.10 ADDITIONAL INFORMATION
I cannot reproduce this error. When you say you are "saving" the file, are you using "Rename" or "Save As" from the File menu in the menu bar? If rename, then it is expected behavior that the old file is moved (not deleted) to the new name/location. I'm not losing work on my end. Would you please clarify the steps to reproduce the issue? Thanks!
Needs more info for triaging. See previous comment.
I thought "saving the file with a new name" was a clear enough reference to the use of "save as". Sorry for the confusion.
One additional thing I have noticed, and which might be related, is that using the "save" function (ctrl+s) opens the save dialogue to give the file a name even when the file already exists, so there seems to be no option to just overwrite the currently-opened file. Is this the intended behaviour? Would this be correlated to the bug at hand?
After more testing, I realised that this bug arises when the files have one of the default names: untitled-$number.md. In that case they are deleted when you save with a "proper" file name, and the ctrl+s shortcut brings up a save dialogue. While I understand the reasoning behind this, this seems to be a consequence of bug 460352. I would say that as long as temporary files are saved in the Documents directory, there is no reason not to treat them like "normal" files.