You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported by: Titus von der Malsburg (Bitbucket: tmalsburg, GitHub: tmalsburg)
The default undo behavior in Evil is too coarse-grained because it considers anything taking place between entering insert mode and leaving it as one edit operation. When you enter a whole paragraph of text during one insert and then execute undo, the whole paragraph is removed. In contrast to that, Vim starts a new undo unit whenever you move the cursor in insert mode (by means other than entering text).
Evil has a customization variable that can be used to get a more fine-grained undo history:
(setq evil-want-fine-undo t)
With this setting, Evil starts a new undo unit when the cursor is moved in insert mode, just like Vim does. However, this setting also messes with how the replace operation is handled: if you replace a word using cw, you have to undo twice to restore the original word: once for removing the new word and once for reinserting the original word. This is inconsistent with Vim and doesn't make much sense because replace should be an atomic operation.
This issue may not be a big problem for people who are mainly writing code. However, if you use Evil to write text (emails, articles, ...), this is a real problem and results in degraded usability.
Original comment byFrank Fischer (Bitbucket: lyro, GitHub: lyro):
add new possible value fine to evil-want-fine-undo (fix #444)
This value causes Evil to behave as if evil-want-fine-undo is t but
merges the deletion of a change operator with the first subsequent
insertion. This is implemented by removing only the first undo
boundary in evil-refresh-undo-step.
Originally reported by: Titus von der Malsburg (Bitbucket: tmalsburg, GitHub: tmalsburg)
The default undo behavior in Evil is too coarse-grained because it considers anything taking place between entering insert mode and leaving it as one edit operation. When you enter a whole paragraph of text during one insert and then execute undo, the whole paragraph is removed. In contrast to that, Vim starts a new undo unit whenever you move the cursor in insert mode (by means other than entering text).
Evil has a customization variable that can be used to get a more fine-grained undo history:
With this setting, Evil starts a new undo unit when the cursor is moved in insert mode, just like Vim does. However, this setting also messes with how the replace operation is handled: if you replace a word using
cw
, you have to undo twice to restore the original word: once for removing the new word and once for reinserting the original word. This is inconsistent with Vim and doesn't make much sense because replace should be an atomic operation.This issue may not be a big problem for people who are mainly writing code. However, if you use Evil to write text (emails, articles, ...), this is a real problem and results in degraded usability.
The text was updated successfully, but these errors were encountered: