Conditionally switch to insert mode on snippet expansion

If already in insert (or emacs) state, don't switch mode when expanding
a yasnippet snippet.
This commit is contained in:
Henrik Lissner 2020-12-11 15:45:06 -05:00
parent 3c8a2a655f
commit 2772ca8e70
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -312,5 +312,7 @@ is."
(defun region-end () evil-visual-end))
(funcall orig-fn no-condition)))
(when (and (bound-and-true-p evil-local-mode)
(not (or (evil-emacs-state-p)
(evil-insert-state-p)))
(yas-active-snippets))
(evil-insert-state +1)))