From 3e14a8534f930e7116d576992c93d33bf7ee38c9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Jan 2024 10:31:17 -0500 Subject: [PATCH] (yas--on-protection-overlay-modification): Fix thinko --- yasnippet.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 63ebfe0..0862f9f 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -3939,7 +3939,8 @@ Move the overlays, or create them if they do not exit." (overlay-put ov 'face 'yas--field-debug-face) (overlay-put ov 'yas--snippet snippet) ;; (overlay-put ov 'evaporate t) - (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification))))))) + (overlay-put ov 'modification-hooks + '(yas--on-protection-overlay-modification))))))) (defun yas--on-protection-overlay-modification (overlay after? beg end &optional length) "Commit the snippet if the protection overlay is being killed." @@ -3947,7 +3948,7 @@ Move the overlays, or create them if they do not exit." yas-inhibit-overlay-modification-protection (not after?) (= length (- end beg)) ; deletion or insertion - (>= beg (overlay-start overlay)) ;Emacs=29.1 bug#65929 + (>= beg (overlay-end overlay)) ;Emacs=29.1 bug#65929 (yas--undo-in-progress)) (let ((snippets (yas-active-snippets))) (yas--message 2 "Committing snippets. Action would destroy a protection overlay.")