branch: master commit e70ca07a27720ab3a46d2185940df7a10bd2d622 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
ivy.el (ivy-call): "C-M-n" should not leave the minibuffer Make sure that the minibuffer window remains selected as long as the completion hasn't finished. For example, "<f1> f" to call `counsel-describe-function' input "forward" and spam "C-M-n" to read the doc for each function that starts with "forward". The *Help* window popup would move the window focus, but this change moves it back to the minibuffer. --- ivy.el | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/ivy.el b/ivy.el index 1bb3326..9b3e698 100644 --- a/ivy.el +++ b/ivy.el @@ -604,7 +604,11 @@ If the input is empty, select the previous history element instead." (if (equal ivy--current "") ivy-text ivy--current)))) - (funcall action x))))) + (prog1 (funcall action x) + (unless (or (eq ivy-exit 'done) + (equal (selected-window) + (active-minibuffer-window))) + (select-window (active-minibuffer-window)))))))) (defun ivy-next-line-and-call (&optional arg) "Move cursor vertically down ARG candidates.