mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +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)
|
(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."
|
||||||
(delete-region start end)
|
(goto-char start)
|
||||||
(insert template))
|
(insert template)
|
||||||
|
(delete-char (- end start)))
|
||||||
|
|
||||||
(defun yas/define (mode key template)
|
(defun yas/define (mode key template)
|
||||||
"Define a snippet. Expanding KEY into TEMPLATE."
|
"Define a snippet. Expanding KEY into TEMPLATE."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user