syl20bnr/evil-escape

Doesn't work with ivy-hydra

Opened this issue · 1 comments

Reproduce:

  1. Enter ivy (SPC b b)
  2. Enter hydra-ivy (C-o)
  3. Press escape sequence to exit minibuffer

I found that ivy exited but hydra-ivy didn't exit.
I changed =evil-escape--escape-normal-state= to

(defun evil-escape--escape-normal-state ()
  "Return the function to escape from normal state."
  (cond
   ((and (fboundp 'helm-alive-p) (helm-alive-p)) 'helm-keyboard-quit)
   ((eq 'ibuffer-mode major-mode) 'ibuffer-quit)
   ((eq 'image-mode major-mode) 'quit-window)
   ((evil-escape--is-magit-buffer) 'evil-escape--escape-with-q)
   ((bound-and-true-p isearch-mode) 'isearch-abort)
   ((window-minibuffer-p) (kbd "C-g"))
   (t (lookup-key evil-normal-state-map [escape]))))

And it works. The reason is that hydra-ivy also binds "C-g" to exit.

Are you still using evil-escape ? If yes and this change has been stable for you, I would be happy to merge this change.