mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
Don't call before/after change-functions twice
* yasnippet.el (yas--snippet-create): Let-bind inhibit-modification-hooks for snippet insertion, so that we don't call change functions automatically, we already call them manually after insertion and parsing.
This commit is contained in:
parent
9f51cf29c9
commit
1d96da2e08
@ -4076,12 +4076,13 @@ Returns the newly created snippet."
|
|||||||
(yas--letenv expand-env
|
(yas--letenv expand-env
|
||||||
;; Put a single undo action for the expanded snippet's
|
;; Put a single undo action for the expanded snippet's
|
||||||
;; content.
|
;; content.
|
||||||
(let ((buffer-undo-list t))
|
(let ((buffer-undo-list t)
|
||||||
|
(inhibit-modification-hooks t))
|
||||||
;; Some versions of cc-mode fail when inserting snippet
|
;; Some versions of cc-mode fail when inserting snippet
|
||||||
;; content in a narrowed buffer, so make sure to insert
|
;; content in a narrowed buffer, so make sure to insert
|
||||||
;; before narrowing. Furthermore, call before and after
|
;; before narrowing. Furthermore, call before and after
|
||||||
;; change functions, otherwise cc-mode's cache can get
|
;; change functions manually, otherwise cc-mode's cache can
|
||||||
;; messed up.
|
;; get messed up.
|
||||||
(goto-char begin)
|
(goto-char begin)
|
||||||
(run-hook-with-args 'before-change-functions begin begin)
|
(run-hook-with-args 'before-change-functions begin begin)
|
||||||
(insert content)
|
(insert content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user