Fix #607; avoid Emacs bug #21824

See also
- https://github.com/capitaomorte/yasnippet/issues/607
- http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21824

* yasnippet.el (yas--on-field-overlay-modification): Do nothing if
  yas--active-field-overlay is not an overlay.
This commit is contained in:
Noam Postavsky 2015-11-03 22:16:17 -05:00
parent fb28ec8384
commit f12164551f

View File

@ -3402,6 +3402,7 @@ Only clears the field if it hasn't been modified and it point it
at field start. This hook doesn't do anything if an undo is in at field start. This hook doesn't do anything if an undo is in
progress." progress."
(unless (or yas--inhibit-overlay-hooks (unless (or yas--inhibit-overlay-hooks
(not (overlayp yas--active-field-overlay)) ; Avoid Emacs bug #21824.
(yas--undo-in-progress)) (yas--undo-in-progress))
(let* ((field (overlay-get overlay 'yas--field)) (let* ((field (overlay-get overlay 'yas--field))
(snippet (overlay-get yas--active-field-overlay 'yas--snippet))) (snippet (overlay-get yas--active-field-overlay 'yas--snippet)))