From 07647e50deffc367f06abb44f77e3ba917f74059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 13 Apr 2018 11:50:19 +0100 Subject: Better protect against modes that disable undo Even though 'evil-start-undo-step' does check buffer-undo-list, it is possible that the forms wrapped by 'evil-with-undo' disable undo in the meantime. In those conditions, 'evil-refresh-undo-step' will eventually error. https://github.com/joaotavora/sly/issues/156 references such an incident. * evil-common.el (evil-end-undo-step): Also check that buffer-undo-list is a list here. --- evil-common.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evil-common.el b/evil-common.el index 381fee0..62eda5f 100644 --- a/evil-common.el +++ b/evil-common.el @@ -3435,7 +3435,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 (and evil-undo-list-pointer + (when (and (listp buffer-undo-list) + evil-undo-list-pointer (not evil-in-single-undo)) (evil-refresh-undo-step) (unless (or continue (null (car-safe buffer-undo-list))) -- cgit v1.0