mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +00:00
Correct manual call to after-change-functions
The pre-change-len argument passed to each element of after-change-fucntions must reflect the length of the affected region before the change happened. In Yasnippet's case, the change enacted in yas--snippet-create is the replacement of a region (which is almost always of length 0) with a ready-to-navigate snippet template. The previous implementation calculated the length of the affected region after that change happened, which is wrong. See https://github.com/joaotavora/eglot/issues/462 for a case where this mattered. * yasnippet.el (yas--snippet-create): Correct manual call to after-change-functions.
This commit is contained in:
parent
5b1217ab08
commit
d3d6d70b1c
@ -4188,7 +4188,7 @@ Returns the newly created snippet."
|
||||
(yas--snippet-parse-create snippet))
|
||||
(run-hook-with-args 'after-change-functions
|
||||
(point-min) (point-max)
|
||||
(- (point-max) (point-min))))
|
||||
(- end begin)))
|
||||
(when (listp buffer-undo-list)
|
||||
(push (cons (point-min) (point-max))
|
||||
buffer-undo-list))
|
||||
|
Loading…
x
Reference in New Issue
Block a user