mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
inhibit-modification-hook
This commit is contained in:
parent
c55a627cad
commit
e3e154e33f
@ -210,13 +210,13 @@ the template of a snippet in the current snippet-table."
|
||||
(defun yas/overlay-insert-in-front-hook (overlay after? beg end &optional length)
|
||||
"Hook for snippet overlay when text is inserted in front of a snippet field."
|
||||
(when after?
|
||||
(let ((field-group (overlay-get overlay 'yas/group)))
|
||||
(let ((field-group (overlay-get overlay 'yas/group))
|
||||
(inhibit-modification-hooks t))
|
||||
(when (not (overlay-get overlay 'yas/modified?))
|
||||
(let ((inhibit-modification-hooks t))
|
||||
(overlay-put overlay 'yas/modified? t)
|
||||
(save-excursion
|
||||
(goto-char end)
|
||||
(delete-char (- (overlay-end overlay) end)))))
|
||||
(delete-char (- (overlay-end overlay) end))))
|
||||
(yas/synchronize-fields field-group))))
|
||||
(defun yas/overlay-insert-behind-hook (overlay after? beg end &optional length)
|
||||
"Hook for snippet overlay when text is inserted just behind a snippet field."
|
||||
@ -225,8 +225,7 @@ the template of a snippet in the current snippet-table."
|
||||
(move-overlay overlay
|
||||
(overlay-start overlay)
|
||||
end)
|
||||
(yas/synchronize-fields
|
||||
(overlay-get overlay 'yas/group))))
|
||||
(yas/synchronize-fields (overlay-get overlay 'yas/group))))
|
||||
|
||||
(defun yas/undo-expand-snippet (start end key snippet)
|
||||
"Undo a snippet expansion. Delete the overlays. This undo can't be
|
||||
|
Loading…
x
Reference in New Issue
Block a user