refactor: shorten advice definition

This commit is contained in:
Kiana Sheibani 2025-04-03 06:45:00 -04:00
parent 1325a53afd
commit c0e00547d5
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -2230,10 +2230,7 @@ If there are any trailing newlines in the snippet file, they will be inserted wh
When editing a snippet, the binding =C-c C-t= can be used to test it in a fresh buffer. This is very useful, but with Evil it has the issue of leaving the editor in normal state, when snippets are designed to be expanded in insert state. When editing a snippet, the binding =C-c C-t= can be used to test it in a fresh buffer. This is very useful, but with Evil it has the issue of leaving the editor in normal state, when snippets are designed to be expanded in insert state.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defadvice! ~/yas-tryout-insert-state (&rest _) (advice-add #'yas-tryout-snippet :after #'evil-insert-state)
"Switch to Insert state when trying out a snippet."
:after #'yas-tryout-snippet
(evil-insert-state))
#+end_src #+end_src
*** Creating New Snippets *** Creating New Snippets