From 637cb0bd2a091d8a4c60e6566a7d7ba3a83fa6a0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 24 Dec 2019 18:15:30 +0100 Subject: 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. --- tools/emacs/config/init.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/emacs/config/init.el b/tools/emacs/config/init.el index 975164383c..307699536c 100644 --- a/tools/emacs/config/init.el +++ b/tools/emacs/config/init.el @@ -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 -- cgit 1.4.1