branch: master
commit a4317f99e9baaab9207d943963fde9c7466289d1
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy--get-window): Return a valid window
Even if STATE is invalid.
---
ivy.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 4858f26..82c94d4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -699,12 +699,14 @@ If the input is empty, select the previous history
element instead."
(defun ivy--get-window (state)
"Get the window from STATE."
- (let ((window (ivy-state-window state)))
- (if (window-live-p window)
- window
- (if (= (length (window-list)) 1)
- (selected-window)
- (next-window)))))
+ (if (ivy-state-p state)
+ (let ((window (ivy-state-window state)))
+ (if (window-live-p window)
+ window
+ (if (= (length (window-list)) 1)
+ (selected-window)
+ (next-window))))
+ (selected-window)))
(defun ivy--actionp (x)
"Return non-nil when X is a list of actions."