Fix doom/kill-buried-buffer closing windows

By making doom/kill-all-buffers less gung ho about deleting windows when
the buffer list is empty.
This commit is contained in:
Henrik Lissner 2019-10-14 18:48:42 -04:00
parent 88af741597
commit 24b336322c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -283,15 +283,16 @@ belong to the current project."
(doom-project-buffer-list) (doom-project-buffer-list)
(doom-buffer-list)) (doom-buffer-list))
t)) t))
(save-some-buffers) (if (null buffer-list)
(delete-other-windows) (message "No buffers to kill")
(when (memq (current-buffer) buffer-list) (save-some-buffers)
(switch-to-buffer (doom-fallback-buffer))) (when (memq (current-buffer) buffer-list)
(mapc #'kill-buffer buffer-list) (switch-to-buffer (doom-fallback-buffer)))
(when interactive (mapc #'doom-kill-buffer-and-windows buffer-list)
(message "Killed %s buffers" (when interactive
(- (length buffer-list) (message "Killed %s buffers"
(length (cl-remove-if-not #'buffer-live-p buffer-list)))))) (- (length buffer-list)
(length (cl-remove-if-not #'buffer-live-p buffer-list)))))))
;;;###autoload ;;;###autoload
(defun doom/kill-other-buffers (&optional buffer-list interactive) (defun doom/kill-other-buffers (&optional buffer-list interactive)