mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
before expansion hook
This commit is contained in:
parent
b2c59c0722
commit
33c0cd5fe1
@ -120,9 +120,7 @@ proper values:
|
||||
|
||||
(defvar yas/before-expand-snippet-hook
|
||||
'()
|
||||
"Hooks to run after a before expanding a snippet.
|
||||
If you move the cursor (e.g. call `re-search-forward') in this hook,
|
||||
please wrap it with `save-excursion', or else yanippet will get confused.")
|
||||
"Hooks to run after a before expanding a snippet.")
|
||||
|
||||
(defvar yas/buffer-local-condition t
|
||||
"Condition to yasnippet local to each buffer.
|
||||
@ -517,6 +515,8 @@ redo-ed."
|
||||
(defun yas/expand-snippet (start end template)
|
||||
"Expand snippet at current point. Text between START and END
|
||||
will be deleted before inserting template."
|
||||
(run-hooks 'yas/before-expand-snippet-hook)
|
||||
|
||||
(goto-char start)
|
||||
|
||||
(let ((key (buffer-substring-no-properties start end))
|
||||
|
Loading…
x
Reference in New Issue
Block a user