Show changes from external apps to the user before overwriting them
- Create
test.txt
containing some original text:echo "Original text" > /tmp/test.txt
- Open
test.txt
in Text Editor:gnome-text-editor /tmp/test.txt
- Replace the contents with
Unsaved Changes from Text Editor
but don't save your changes - Simulate a Text Editor crash:
killall gnome-text-editor
- At this point
/tmp/test.txt
still contains"Original text"
- Edit the contents of
test.txt
using a different program (not Text Editor):echo "External changes" > /tmp/test.txt
- Re-launch Text Editor
Text Editor will display its Draft Changes Restored dialog and will show the contents of the file as Unsaved Changes from Text Editor
. At this point the contents of /tmp/test.txt
on disk are External changes
.
If you click Save... in Text Editor it will overwrite External changes
with Unsaved Changes from Text Editor
but Text Editor never gave the user any indication that there were external changes that were going to be overwritten. There is a dialog that says Save Changes to "test.txt"? Saving changes will replace the previously saved version but this dialog is always shown (whether there are external changes or not) and doesn't make it clear to the user that there are changes from an external app that are going to be overwritten, and it doesn't show the user what the changes that're going to be overwritten are.
It would be good if Text Editor could show the user both its saved draft copy and the current copy on disk and let the user choose which copy to continue with