From 82818e54605fdb19f95c7e706958db32bd525e1d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 16 May 2017 21:40:06 -0400 Subject: [PATCH] Don't delete snippets more than once. * yasnippet.el (yas--on-field-overlay-modification): Don't commit snippet again if the the triggering overlay has already been deleted. --- yasnippet.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yasnippet.el b/yasnippet.el index fbdb461..77e9fc7 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -3580,6 +3580,11 @@ field start. This hook does nothing if an undo is in progress." (unless (or (not after?) yas--inhibit-overlay-hooks (not (overlayp yas--active-field-overlay)) ; Avoid Emacs bug #21824. + ;; If a single change hits multiple overlays of the same + ;; snippet, then we delete the snippet the first time, + ;; and then subsequent calls get a deleted overlay. + ;; Don't delete the snippet again! + (not (overlay-buffer overlay)) (yas--undo-in-progress)) (let* ((inhibit-modification-hooks nil) (yas--inhibit-overlay-hooks t)