From 58463b4cb05615e226d98abc72aa11ec73c3d156 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Tue, 5 Feb 2019 14:57:48 +0100 Subject: [PATCH] ace-window.el (aw-select): Fix when selecting from an ignored window When there are three windows, and the ignored one is selected, the length of (aw-window-list) is 2, but we should still dispatch because neither of the 2 is selected at the moment. Fixes #161 --- ace-window.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ace-window.el b/ace-window.el index ae77bf1..bc9a446 100644 --- a/ace-window.el +++ b/ace-window.el @@ -216,9 +216,7 @@ or ;; Ignore major-modes and buffer-names in `aw-ignored-buffers'. (or (memq (buffer-local-value 'major-mode (window-buffer window)) aw-ignored-buffers) - (member (buffer-name (window-buffer window)) aw-ignored-buffers)) - (or aw-ignore-current - (not (equal window (selected-window))))) + (member (buffer-name (window-buffer window)) aw-ignored-buffers))) ;; ignore child frames (and (fboundp 'frame-parent) (frame-parent (window-frame window))) ;; Ignore selected window if `aw-ignore-current' is non-nil. @@ -480,7 +478,8 @@ Amend MODE-LINE to the mode line for the duration of the selection." (when (eq aw-action 'exit) (setq aw-action nil))) (or (car wnd-list) start-window)) - ((and (<= (length wnd-list) aw-dispatch-when-more-than) + ((and (<= (+ (length wnd-list) (if (aw-ignored-p start-window) 1 0)) + aw-dispatch-when-more-than) (not aw-dispatch-always) (not aw-ignore-current)) (let ((wnd (next-window nil nil next-window-scope)))