diff options
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 93cf3b0fb10..4bd819ab828 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -1715,8 +1715,9 @@ invokes the command before that, etc." | |||
| 1715 | (let ((inhibit-quit t) | 1715 | (let ((inhibit-quit t) |
| 1716 | tmp tmp2) | 1716 | tmp tmp2) |
| 1717 | (setq viper-undo-needs-adjustment nil) | 1717 | (setq viper-undo-needs-adjustment nil) |
| 1718 | (if (listp buffer-undo-list) | 1718 | (when (listp buffer-undo-list) |
| 1719 | (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list)) | 1719 | (let ((had-boundary (null (car buffer-undo-list)))) |
| 1720 | (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list)) | ||
| 1720 | (progn | 1721 | (progn |
| 1721 | (setq tmp2 (cdr tmp)) ; the part after mark | 1722 | (setq tmp2 (cdr tmp)) ; the part after mark |
| 1722 | 1723 | ||
| @@ -1729,8 +1730,11 @@ invokes the command before that, etc." | |||
| 1729 | (delq viper-buffer-undo-list-mark buffer-undo-list)) | 1730 | (delq viper-buffer-undo-list-mark buffer-undo-list)) |
| 1730 | ;; restore tail of buffer-undo-list | 1731 | ;; restore tail of buffer-undo-list |
| 1731 | (setq buffer-undo-list (nconc buffer-undo-list tmp2))) | 1732 | (setq buffer-undo-list (nconc buffer-undo-list tmp2))) |
| 1732 | (setq buffer-undo-list (delq nil buffer-undo-list))))) | 1733 | (setq buffer-undo-list (delq nil buffer-undo-list))) |
| 1733 | )) | 1734 | ;; The top-level loop only adds boundaries if there has been |
| 1735 | ;; modifications in the buffer, so make sure we don't accidentally | ||
| 1736 | ;; drop the "final" boundary (bug#22295). | ||
| 1737 | (if had-boundary (undo-boundary))))))) | ||
| 1734 | 1738 | ||
| 1735 | 1739 | ||
| 1736 | (defun viper-set-complex-command-for-undo () | 1740 | (defun viper-set-complex-command-for-undo () |