Fix +eshell-enable-new-shell-on-split

Also enables this implicitly after opening eshell with
+eshell/open-fullscreen.
This commit is contained in:
Henrik Lissner 2018-06-27 19:34:48 +02:00
parent 5bcec25529
commit dceb9bea09
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -23,9 +23,9 @@
(defun +eshell--bury-buffer () (defun +eshell--bury-buffer ()
(unless (switch-to-prev-buffer nil 'bury) (unless (switch-to-prev-buffer nil 'bury)
(switch-to-buffer (doom-fallback-buffer)) (switch-to-buffer (doom-fallback-buffer)))
(when +eshell-enable-new-shell-on-split (when +eshell-enable-new-shell-on-split
(+eshell/open t)))) (+eshell/open t)))
(defun +eshell--setup-window (window &optional flag) (defun +eshell--setup-window (window &optional flag)
(when (window-live-p window) (when (window-live-p window)
@ -163,15 +163,22 @@ delete."
(defun +eshell/split-below () (defun +eshell/split-below ()
"Create a new eshell window below the current one." "Create a new eshell window below the current one."
(interactive) (interactive)
(select-window (split-window-vertically)) (let ((ignore-window-parameters t)
(+eshell--bury-buffer)) (+eshell-enable-new-shell-on-split
(or +eshell-enable-new-shell-on-split (frame-parameter nil 'saved-wconf))))
(select-window (split-window-vertically))
(+eshell--bury-buffer)))
;;;###autoload ;;;###autoload
(defun +eshell/split-right () (defun +eshell/split-right ()
"Create a new eshell window to the right of the current one." "Create a new eshell window to the right of the current one."
(interactive) (interactive)
(select-window (split-window-horizontally)) (let* ((ignore-window-parameters t)
(+eshell--bury-buffer)) (window-state (window-state-get))
(+eshell-enable-new-shell-on-split
(or +eshell-enable-new-shell-on-split (frame-parameter nil 'saved-wconf))))
(select-window (split-window-horizontally))
(+eshell--bury-buffer)))
;;;###autoload ;;;###autoload
(defun +eshell/switch-to-next () (defun +eshell/switch-to-next ()