Fix invoking helpful-key from evil-ex

This should probably be reported upstream, but to whom? Helpful? Evil?
The Doom slayer?
This commit is contained in:
Henrik Lissner 2020-04-17 23:08:17 -04:00
parent b82068cdcc
commit afcdae4fff
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -144,6 +144,15 @@ directives. By default, this only recognizes C directives.")
(when (eq major-mode 'fundamental-mode) (when (eq major-mode 'fundamental-mode)
(hack-local-variables))) (hack-local-variables)))
;; HACK Invoking helpful from evil-ex throws a "No recursive edit is in
;; progress" error because, between evil-ex and helpful,
;; `abort-recursive-edit' gets called one time too many.
(defadvice! +evil--fix-helpful-key-in-evil-ex-a (key-sequence)
:before #'helpful-key
(when (evil-ex-p)
(run-at-time 0.1 nil #'helpful-key key-sequence)
(abort-recursive-edit)))
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'. ;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
(advice-add #'evil-force-normal-state :after #'+evil-escape-a) (advice-add #'evil-force-normal-state :after #'+evil-escape-a)