Naughty undo-tree

Titus von der Malsburg malsburg at posteo.de
Mon Nov 10 19:00:53 CET 2014


I think there are two issues:

- the variable size of undo steps
- the error when redoing.

The first issue arises from the fact that Evil considers anything that
happens from entering insert mode until leaving it as one edit.  So if
you enter insert mode, type one character, and leave insert mode, undo
deletes a single character.  However, if you enter a whole paragraph in
insert mode, undo will remove that paragraph.  This is not consistent
with Vim's behavior.  In Vim, a new edit unit is started whenever you
move the cursor in insert mode (by means other than entering
text).  Depending on how you work, this may still give you a too
coarse-grained granularity but it's better than what Evil does.

Evil has a customization variable that allows you to change the
granularity of edits in the undo history:

  (setq evil-want-fine-undo t)

With this setting, you also get new edit units when moving the cursor in
insert mode.  However, it also messes with how things like the `cw`
operation are handled.  In Vim, replacing a word by another and then
undoing reverts to the original word in one step.  In Evil with the
above setting, you have to undo twice: once for inserting the new word
and once for deleting the old word.  This is rarely what you want and in
my opinion breaks the semantics of the replace operation (which should
be atomic).

The second issue is the error that you're observing when redoing.  I
never encountered this problem.

  Titus


On 2014-11-10 Mon 09:01, Barry OReilly wrote:
> It's a known issue with undo tree unrelated to evil.
> On Nov 10, 2014 7:41 AM, "Óscar Fuentes" <ofv at wanadoo.es> wrote:
>
>> From time to time undo-tree behaves strangely. With a single undo step
>> it can undo a char insert or whole paragraphs that took several minutes
>> to enter. Worse, sometimes it fails while trying to redo with:
>>
>>   primitive-undo: Unrecognized entry in undo list undo-tree-canary
>>
>> Combined with one of those huge undo steps, this amounts to serious data
>> loss.
>>
>> Does someone else experience these problems?
>>
>> Is Evil handicapped in some way if I stop using undo-tree?
>>
>>
>> _______________________________________________
>> implementations-list mailing list
>> implementations-list at lists.ourproject.org
>> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
>>
> _______________________________________________
> implementations-list mailing list
> implementations-list at lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/implementations-list/attachments/20141110/9e068cdf/attachment.pgp 


More information about the implementations-list mailing list