branch: master
commit 18f300a404d4942f3d5f393db2e6ceee71b3c704
Merge: 291e93f 45c97bb
Author: abo-abo <ohwoeo...@gmail.com>
Commit: abo-abo <ohwoeo...@gmail.com>

    Merge pull request #5 from kyleam/fix-selection
    
    Fix selection when two single-window frames
---
 ace-window.el |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/ace-window.el b/ace-window.el
index 602ccad..518e117 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -138,7 +138,7 @@ HANDLER is a function that takes a window argument."
            (0)
            (1)
            (2
-            (,handler (next-window)))
+            (,handler (next-window nil nil 'visible)))
            (t
             (let ((candidate-list
                    (mapcar (lambda (va)
@@ -230,16 +230,18 @@ Windows are numbered top down, left to right."
 
 (defun aw-switch-to-window (position)
   "Switch to window of `aj-position' structure POSITION."
-  (if (windowp position)
-      (select-window position)
-    (let ((frame (aj-position-frame position))
-          (window (aj-position-window position)))
-      (if (and (frame-live-p frame)
-               (not (eq frame (selected-frame))))
-          (select-frame-set-input-focus (window-frame window)))
-      (if (and (window-live-p window)
-               (not (eq window (selected-window))))
-          (select-window window)))))
+  (let (frame window)
+    (if (windowp position)
+        (setq frame (window-frame position)
+              window position)
+      (setq frame (aj-position-frame position)
+            window (aj-position-window position)))
+    (if (and (frame-live-p frame)
+             (not (eq frame (selected-frame))))
+        (select-frame-set-input-focus frame))
+    (if (and (window-live-p window)
+             (not (eq window (selected-window))))
+        (select-window window))))
 
 (defun aw-delete-window (position)
   "Delete window of `aj-position' structure POSITION."

Reply via email to