abo-abo / ace-window

Quickly switch windows in Emacs
970 stars 86 forks source link

Ignored window is not ignored when it is selected-window #161

Closed Alexander-Miller closed 5 years ago

Alexander-Miller commented 5 years ago

No idea how I missed that when I tested your last fix.

Take the following situation - org-mode is ignored and the top window showing the org-mode buffer is selected. The current behavior is that calling ace-select-window offers the option to select any one of the 3 windows. (This only occurs when a window that should be ignored is selected) The expected behavior is for the first window to be ignored.

abo-abo commented 5 years ago

I thought that was what you wanted. You have 3 windows, one of them is ignored and currently selected.

With the old behavior, ace-window will think there are only 2 windows and switch to one of them, in the current window order. This may be sub-optimal, maybe the user wants to select the window, instead of possibly having to call ace-window again if the wrong window was selected.

With the new behavior, you can select any of the three windows.

Alexander-Miller commented 5 years ago

It's 2 different cases at play (if I had known about aw-ignore-current I would've just let-bound that, but it's too late for that now).

In the first case the problem was as follows: there's 3 windows, 1 is ignored, 1 is currently selected, so that leaves only 1 target, so ace-window skips the dispatch. But that is wrong when the ignored window and the selected window are the same. In that case there are 2 valid targets so the dispatch should happen to select one of them. That is what my first issue was about.

Now it's different. When the ignored and selected window are the same the ignored window is not ignored. So this

With the new behavior, you can select any of the three windows.

isn't right. At least as a user I would find it highly unexpected that an ignored window type won't be ignored just because that window is focused.

abo-abo commented 5 years ago

Thanks, please test.