Fix aw-switch-buffer-other-window bug

When aw-switch-buffer-other-window is executed, it switches to the
selected window, changes the buffer, and then switches back. If the
buffer-switching function is canceled, the window won't get switched
back. Using unwind-protect ensures that the function ends with the
starting window selected.
old-master
Nick Drozd 8 years ago
parent a2f1dd5c28
commit 9ca16c6bc3
  1. 7
      ace-window.el

@ -750,10 +750,11 @@ Modify `aw-fair-aspect-ratio' to tweak behavior."
(aw-split-window-vert window))))
(defun aw-switch-buffer-other-window (window)
"Switch buffer in WINDOW without selecting WINDOW."
"Switch buffer in WINDOW."
(aw-switch-to-window window)
(aw--switch-buffer)
(aw-flip-window))
(unwind-protect
(aw--switch-buffer)
(aw-flip-window)))
(defun aw--face-rel-height ()
(let ((h (face-attribute 'aw-leading-char-face :height)))

Loading…
Cancel
Save