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))
(if (null buffer-list)
(message "No buffers to kill")
(save-some-buffers) (save-some-buffers)
(delete-other-windows)
(when (memq (current-buffer) buffer-list) (when (memq (current-buffer) buffer-list)
(switch-to-buffer (doom-fallback-buffer))) (switch-to-buffer (doom-fallback-buffer)))
(mapc #'kill-buffer buffer-list) (mapc #'doom-kill-buffer-and-windows buffer-list)
(when interactive (when interactive
(message "Killed %s buffers" (message "Killed %s buffers"
(- (length buffer-list) (- (length buffer-list)
(length (cl-remove-if-not #'buffer-live-p 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)