yas/exit-snippet called interactively exits the most recently inserted snippet (issue #196)

This commit is contained in:
João Távora 2011-11-30 00:37:40 +00:00
parent e53c41d726
commit 11fb69f0c0

View File

@ -2994,11 +2994,12 @@ Also create some protection overlays"
(defun yas/exit-snippet (snippet) (defun yas/exit-snippet (snippet)
"Goto exit-marker of SNIPPET." "Goto exit-marker of SNIPPET."
(interactive) (interactive (list (first (yas/snippets-at-point))))
(when snippet
(setf (yas/snippet-force-exit snippet) t) (setf (yas/snippet-force-exit snippet) t)
(goto-char (if (yas/snippet-exit snippet) (goto-char (if (yas/snippet-exit snippet)
(yas/exit-marker (yas/snippet-exit snippet)) (yas/exit-marker (yas/snippet-exit snippet))
(overlay-end (yas/snippet-control-overlay snippet))))) (overlay-end (yas/snippet-control-overlay snippet))))))
(defun yas/exit-all-snippets () (defun yas/exit-all-snippets ()
"Exit all snippets." "Exit all snippets."