fix(emacs.d): Pick new buffers *into* the active window

Instead of splitting below and moving the target buffer into the new
split, split and move the buffer into the active window.

The other way around does (for some reason I don't fully understand)
not work because `split-window-below` may return invalid windows.
This commit is contained in:
Vincent Ambo 2019-12-24 18:15:30 +01:00
parent ceaa0ff0ba
commit 637cb0bd2a

View file

@ -55,10 +55,10 @@
:keymap ivy-switch-buffer-map
:preselect (buffer-name (other-buffer (current-buffer)))
:action (lambda (buffer)
(let ((new-window (split-window-below)))
(edwina-arrange)
(with-selected-window new-window
(switch-to-buffer buffer nil 'force-same-window))))
(interactive)
(split-window-below)
(switch-to-buffer buffer nil 'force-same-window)
(edwina-arrange))
:matcher #'ivy--switch-buffer-matcher
:caller 'ivy-switch-buffer))
:bind (:map edwina-mode-map