(yas--on-protection-overlay-modification): Fix thinko

This commit is contained in:
Stefan Monnier 2024-01-18 10:31:17 -05:00
parent 9f253badfb
commit 3e14a8534f

View File

@ -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 'face 'yas--field-debug-face)
(overlay-put ov 'yas--snippet snippet) (overlay-put ov 'yas--snippet snippet)
;; (overlay-put ov 'evaporate t) ;; (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) (defun yas--on-protection-overlay-modification (overlay after? beg end &optional length)
"Commit the snippet if the protection overlay is being killed." "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 yas-inhibit-overlay-modification-protection
(not after?) (not after?)
(= length (- end beg)) ; deletion or insertion (= 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)) (yas--undo-in-progress))
(let ((snippets (yas-active-snippets))) (let ((snippets (yas-active-snippets)))
(yas--message 2 "Committing snippets. Action would destroy a protection overlay.") (yas--message 2 "Committing snippets. Action would destroy a protection overlay.")