mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13: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
|
(defvar yas/before-expand-snippet-hook
|
||||||
'()
|
'()
|
||||||
"Hooks to run after a before expanding a snippet.
|
"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.")
|
|
||||||
|
|
||||||
(defvar yas/buffer-local-condition t
|
(defvar yas/buffer-local-condition t
|
||||||
"Condition to yasnippet local to each buffer.
|
"Condition to yasnippet local to each buffer.
|
||||||
@ -517,6 +515,8 @@ redo-ed."
|
|||||||
(defun yas/expand-snippet (start end template)
|
(defun yas/expand-snippet (start end template)
|
||||||
"Expand snippet at current point. Text between START and END
|
"Expand snippet at current point. Text between START and END
|
||||||
will be deleted before inserting template."
|
will be deleted before inserting template."
|
||||||
|
(run-hooks 'yas/before-expand-snippet-hook)
|
||||||
|
|
||||||
(goto-char start)
|
(goto-char start)
|
||||||
|
|
||||||
(let ((key (buffer-substring-no-properties start end))
|
(let ((key (buffer-substring-no-properties start end))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user