mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
undo-friendly delete-and-insert
This commit is contained in:
parent
9a9182ac47
commit
f1e60eb3e0
@ -61,8 +61,9 @@ expanded.")
|
||||
(defun yas/expand-snippet (start end template)
|
||||
"Expand snippet at current point. Text between START and END
|
||||
will be deleted before inserting template."
|
||||
(delete-region start end)
|
||||
(insert template))
|
||||
(goto-char start)
|
||||
(insert template)
|
||||
(delete-char (- end start)))
|
||||
|
||||
(defun yas/define (mode key template)
|
||||
"Define a snippet. Expanding KEY into TEMPLATE."
|
||||
|
Loading…
x
Reference in New Issue
Block a user