diff options
| author | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2013-02-18 23:10:52 +0100 |
|---|---|---|
| committer | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2013-02-18 23:10:52 +0100 |
| commit | 5e3fa2b8512c1dbefe2ab9c156b6ca2f9ffcf68d (patch) | |
| tree | d41c6f9ae344fa8a80200d9e068b4ade019d3586 | |
| parent | fd5087caaf0116d7c71ce23cb0dbf0f8d3b7412a (diff) | |
Guard `evil-start-undo-step` and `evil-end-undo-step` within single undo
These functions are not only called from `evil-with-single-undo`, but
also when insert state starts and ends.
| -rw-r--r-- | evil-common.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/evil-common.el b/evil-common.el index 61d1740..6746a5c 100644 --- a/evil-common.el +++ b/evil-common.el @@ -2823,7 +2823,8 @@ If no description is available, return the empty string." All following buffer modifications are grouped together as a single action. If CONTINUE is non-nil, preceding modifications are included. The step is terminated with `evil-end-undo-step'." - (when (listp buffer-undo-list) + (when (and (listp buffer-undo-list) + (not evil-in-single-undo)) (if evil-undo-list-pointer (evil-refresh-undo-step) (unless (or continue (null (car-safe buffer-undo-list))) @@ -2833,7 +2834,8 @@ are included. The step is terminated with `evil-end-undo-step'." (defun evil-end-undo-step (&optional continue) "End a undo step started with `evil-start-undo-step'. Adds an undo boundary unless CONTINUE is specified." - (when evil-undo-list-pointer + (when (and evil-undo-list-pointer + (not evil-in-single-undo)) (evil-refresh-undo-step) (unless continue (undo-boundary)) @@ -2879,10 +2881,10 @@ is stored in `evil-temporary-undo' instead of `buffer-undo-list'." (evil-with-undo (unwind-protect (progn - (unless evil-in-single-undo (evil-start-undo-step)) + (evil-start-undo-step) (let ((evil-in-single-undo t)) ,@body)) - (unless evil-in-single-undo (evil-end-undo-step)))))) + (evil-end-undo-step))))) (defun evil-undo-pop () "Undo the last buffer change. |
