Thu 18 Aug 2011 11:05:00 AM UTC, original submission:
Technically this is a new feature, but since in involves data loss, I think it's important enough to consider to be a bug... same for C and Lua branches:
$ echo foo > y
$ zile y
^Z
$ echo bar > y
$ fg
xxx^X^S^X^C
$ cat y
xxxfoo
Where did the 'bar' go?
With emacs, at the point you press the first 'x' it says:
y changed on disk, really edit the buffer? (y, n, r, C-h) _
and if you accept by pressing y:
File on disk will now become a backup file if you save these changes
and then when you actually try to save:
y has changed since visited or saved. Save anyway? (yes or no)
Dunno if we need to go quite that far, but we definitely need to spot files that have been externally changed before saving over them.
Aside: For zi (at least), I much prefer TextMate's handling of external edits: it quietly updates the buffer with the new contents of the file if the buffer has not been edited yet, or else asks whether to revert to the disk contents, or keep the buffer intact.
|