branch: master
commit adad288b69785a02e7207bfc00390f6ddb0429a8
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-call): Add selected-window work-around for M-x
* ivy.el (ivy-call): For some commands that depend on the buffer, like
`counsel-git-grep' the action needs to be performed in
`ivy-state-window'. However, this results in wrong window for M-x calc.
Add a workaround until I figure out why this happens.
Fixes #176
---
ivy.el | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 59221e2..8237704 100644
--- a/ivy.el
+++ b/ivy.el
@@ -550,8 +550,10 @@ If the input is empty, select the previous history element
instead."
(consp (car collection)))
(cdr (assoc ivy--current collection))
ivy--current)))
- (with-selected-window (ivy-state-window ivy-last)
- (funcall action x))))))
+ (if (eq (ivy-state-history ivy-last) 'extended-command-history)
+ (funcall action x)
+ (with-selected-window (ivy-state-window ivy-last)
+ (funcall action x)))))))
(defun ivy-next-line-and-call (&optional arg)
"Move cursor vertically down ARG candidates.