From 2772ca8e70996f704e41936b55bd0957d416739a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 11 Dec 2020 15:45:06 -0500 Subject: [PATCH] Conditionally switch to insert mode on snippet expansion If already in insert (or emacs) state, don't switch mode when expanding a yasnippet snippet. --- modules/editor/snippets/autoload/snippets.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/editor/snippets/autoload/snippets.el b/modules/editor/snippets/autoload/snippets.el index 1a651e6d2..90468383e 100644 --- a/modules/editor/snippets/autoload/snippets.el +++ b/modules/editor/snippets/autoload/snippets.el @@ -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)))