emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a4317f9 002/272: ivy.el (ivy--get-window): Return a valid


From: Oleh Krehel
Subject: [elpa] master a4317f9 002/272: ivy.el (ivy--get-window): Return a valid window
Date: Mon, 25 Apr 2016 10:13:13 +0000

branch: master
commit a4317f99e9baaab9207d943963fde9c7466289d1
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]