GNOME Bugzilla – Bug 154475
Don't prompt to save missing (removed files)
Last modified: 2004-12-22 21:47:04 UTC
To reproduce: date > asdf; gedit asdf&; sleep 5; rm asdf Quit gedit - you will be prompted to save asdf even though you have no changes to it and have removed it. Expected behaviour: If the buffer has no changes, allow closing without a prompt. If the buffer has changes, warn that the file has disappeared and prompt to save or discard
If the file is deleted while it is open in gedit we give the user the chance to save the contents. That's on purpose, then the user is free to chose "Do not save". Why would you not have such behavior? bug #75861 contains some advice on how to improve the current solution.
I strongly disagree with that use case. 1) It's not the editors job to prevent data loss when a file is removed - it is likely that the user was already prompted to remove them in the first place. Why would they want to be asked again? (It's not so bad with one file but I frequently drop a folders contents to check if theres anything worth saving) 2) No other editor behaves that way. (probably because of (1)) I've tried vim, xedit, anjuta, windows notepad, devstudio, even the gimp! IMHO the correct solution is to warn the user in a non intrusive manner such as changing the icon on the notebook tab and/or a status line message. The user should only be prompted to save changes if they have made changes!
What if the cause of the file's disappearance is that the volume it resides on has been unmounted, or if it has been opened through the vfs layer? You would reasonably want to be alerted so that you can squirrel away a copy so you won't have to redo the work again later.