Don't invoke doom/escape too eagerly from evil

This fixes an issue where certain evil plugins would call
evil-force-normal-state non-interactively, causing `doom-escape-hook` to
wreck havoc. Instead, this should only happen when
evil-force-normal-state is called interactively (e.g. via ESC in normal
mode).

Fixes evil-mc-make-cursor-move-next-line and
evil-mc-make-cursor-move-prev-line.
This commit is contained in:
Henrik Lissner 2018-06-07 02:43:07 +02:00
parent ef9d8fb2e8
commit 69a796ff60
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 7 additions and 1 deletions

View file

@ -358,3 +358,9 @@ more information on modifiers."
(when (and (not count) evil-auto-balance-windows)
(balance-windows (window-parent)))
(if file (evil-edit file)))
;;;###autoload
(defun +evil*escape (&rest _)
"Call `doom/escape' if `evil-force-normal-state' is called interactively."
(when (called-interactively-p 'any)
(call-interactively #'doom/escape)))