[Geany-Devel] f403e7e (PR#188) - Maintain edit history on document reload

Thomas Martitz kugel at xxxxx
Wed Jun 24 18:54:14 UTC 2015

Am 24.06.2015 um 18:30 schrieb Colomban Wendling:
> Le 24/06/2015 17:04, Thomas Martitz a écrit :
>> Hello
>> I have just noticed that current git, by default, doesn't prompt anymore
>> when reloading documents, even when they are changed.
>> I traced it back to the $SUBJECT commit. IMO it's fine to keep the undo
>> history on reload and not prompt, but it's not fine if the file is
>> currently modified (unsaved) and reloading throws all unsaved changes
>> away, without warning.
>> This is especially problematic because the new pref is on by default so
>> users will probably be surprised by the new, changed behavior and lose
>> some hours of work (happend to me...).
> How does it loose work?  you can undo the reload and you get your stuff
> back, don't you?

Ah yes, that seems to work. I didn't even think of that (not sure why, 
but redo would seem more natural to me here). Anyway the new default 
behavior seems awkward to, surprising and unexpected in some way.

I haven't looked at the code. Is the diff of the buffer and the file 
applied and recorded as an ordinary undo action?

>> I'm asking for restoring the prompt (by default), at the very least if
>> the file is unsaved.
> Would be fine with me, as I don't think reload is something done so
> often that a confirmation would be much pain.  We could restore the
> previous confirmation behavior.
> "offending" commit is
> https://github.com/geany/geany/commit/660c441b4af272fe4e40eb6a6cda2badb8f17eac
> I guess.

Okay, with the "undo the reload" it's not as bad as I thought. However I 
still find the new default behavior confusing, especially for regular 
long time users like me.

However, just restoring the prompt is also not ideal. Since the undo 
history is now remembered the prompt would be wrong (either way, for 
unsaved buffer it says "Any unsaved changes will be lost." and for saved 
buffer "Undo history will be lost.").

I think one could improve the prompt depending on the pref. I think it 
would best to even incooperate a check box for the pref (like "[ ] 
Remember undo history" and "[ ] don't ask again" [the latter being 
insensitive if the first is unchecked]). How does that sound?

Best regards.

More information about the Devel mailing list