From 6bfac0ada2b2801f730692fe84730c426b2bcc01 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 26 May 2018 21:22:38 +0200 Subject: [PATCH] tools/eshell: fix split-window behavior not burying eshell This happens when there is no other buffer to replace it with. --- modules/tools/eshell/autoload/eshell.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/tools/eshell/autoload/eshell.el b/modules/tools/eshell/autoload/eshell.el index 33e36842b..ae81c4530 100644 --- a/modules/tools/eshell/autoload/eshell.el +++ b/modules/tools/eshell/autoload/eshell.el @@ -169,19 +169,23 @@ delete." (eshell-life-is-too-much) (delete-char arg))) +(defsubst +eshell--bury-buffer () + (unless (switch-to-prev-buffer nil 'bury) + (switch-to-buffer (doom-fallback-buffer)))) + ;;;###autoload (defun +eshell/split-below () "Create a new eshell window below the current one." (interactive) (select-window (split-window-vertically)) - (bury-buffer)) + (+eshell--bury-buffer)) ;;;###autoload (defun +eshell/split-right () "Create a new eshell window to the right of the current one." (interactive) (select-window (split-window-horizontally)) - (bury-buffer)) + (+eshell--bury-buffer)) ;; `make-ring' ;; `ring-ref'