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

Matthew Brush mbrush at xxxxx
Thu Jun 25 00:36:54 UTC 2015


On 2015-06-24 02:30 PM, Lex Trotman wrote:
> On 25 June 2015 at 06:54, Thomas Martitz <kugel at rockbox.org> wrote:
>> Am 24.06.2015 um 22:26 schrieb Lex Trotman:
>>>
>>> I'm struggling to understand why there is any confusion, reload is an
>>> editing action just like any other and can be undone like any other. Seems
>>> much safer to me and exactly what to expect. It used to have a side effect
>>> that was unexpected and nasty which was why it had a dialog warning of that,
>>> now it doesn't, so its just like any other command.
>>
>>
>> To me, reloading the file from disk is clearly not like any other editing
>> command. It's got more to do with file management than editing, and given
>> the previous behavior it's easy to be confused as an existing user. I also
>> don't think any other editor out there works like this so I can see it being
>> unexpected for new users as well.
>
> Welcome to a new paradigm :)
>
>>
>>>> I haven't looked at the code. Is the diff of the buffer and the file
>>>> applied
>>>> and recorded as an ordinary undo action?
>>>
>>> Thats up to Scintilla how it records the reload.
>>
>>
>> I was wondering if we do anything special to support this. I guess not.
>>
>>> Indeed long time users who are used to the old wrong behaviour need to
>>> unlearn the wrong one. But that doesn't mean we should prompt every time we
>>> do it right.
>>
>>
>>
>> Some kind of help/guidance for users who do not expect the new behavior
>> (either because are existing users or coming from other editors[1]) would be
>> nice, if possible. And since it seems really unique across editors (and
>
> Most [1] other editors call this command "revert" and they clear the
> edit history, that makes sense, they are "reverting" the buffer to its
> initial state.  So they have prompts.
>
> Geany is just reloading the file contents as another editing action.
>
>> consequently potentially unexpected) some kind of introduction to the
>> feature would be really helpful. I, for one, got really trapped. I'd say the
>> dialog I proposed can accomplish that, while maintaining the ability to
>> never have the prompt again.
>
> Since Geany is clearly ahead of the pack here maybe we *should* have a a dialog:
>
>    Did you know that reloading is just another editing action and can
> be undone like all the rest?
>

...even though it's going out to disk like all file actions and unlike 
other editing action, and is also found under the File menu and not the 
Edit menu...  :)

>    It is not like other editors crappy destructive "revert" commands.
>

...even though it used to be ...

>    [ ] Don't show again
>
>    This advertisement is brought to you by the Geany team to emphasise
> its awesomeness.
>

And memory manufacturers everywhere :)

Sarcasm aside, I think it's a fine feature, maybe slightly confusing 
since the existing behaviour changed, and isn't similar to most editors. 
Other than that, clearing the visible "dirty" state and using 
sizeof(doc)*n_reloads of memory in Scintilla undo buffer, it's not a bad 
idea. It's convenient and seemingly safe.

I wonder if there's a more simple way to reduce confusion and increase 
visibility other than an annoying dialog or document message. Maybe as a 
separate action with a different name in the edit menu?

Cheers,
Matthew Brush



More information about the Devel mailing list