Don't exclude last character on visual yas-insert-snippet

This commit is contained in:
Henrik Lissner 2016-03-13 15:29:58 -04:00
parent 1eba7ff3a3
commit 3145cd315a

View file

@ -23,6 +23,12 @@ normal mode if there are no fields."
"Switch to insert mode when expanding a template via backtab, or go back to "Switch to insert mode when expanding a template via backtab, or go back to
normal mode if there are no fields." normal mode if there are no fields."
(interactive) (interactive)
(when (evil-visual-state-p)
(let ((end (region-end)))
(evil-visual-select
(region-beginning)
(if (eq evil-this-type 'line) end (1+ end))
'inclusive)))
(yas-insert-snippet) (yas-insert-snippet)
(let* ((snippet (first (yas--snippets-at-point))) (let* ((snippet (first (yas--snippets-at-point)))
(fields (yas--snippet-fields snippet))) (fields (yas--snippet-fields snippet)))