Push modifications to buffer-undo-list, even if unwinding

This commit is contained in:
Benson Chu 2022-10-23 11:36:33 -05:00
parent eb5ba2664c
commit ce54f1958f

View File

@ -4128,6 +4128,7 @@ Returns the newly created snippet."
(yas--letenv expand-env (yas--letenv expand-env
;; Put a single undo action for the expanded snippet's ;; Put a single undo action for the expanded snippet's
;; content. ;; content.
(unwind-protect
(let ((buffer-undo-list t)) (let ((buffer-undo-list t))
(goto-char begin) (goto-char begin)
(if (> emacs-major-version 29) (if (> emacs-major-version 29)
@ -4160,7 +4161,7 @@ Returns the newly created snippet."
(- end begin)))) (- end begin))))
(when (listp buffer-undo-list) (when (listp buffer-undo-list)
(push (cons (point-min) (point-max)) (push (cons (point-min) (point-max))
buffer-undo-list)) buffer-undo-list)))
;; Indent, collecting undo information normally. ;; Indent, collecting undo information normally.
(yas--indent snippet) (yas--indent snippet)