diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index aa26265ba..d11cad126 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -142,7 +142,8 @@ popup window/buffer and b) isn't a special buffer." (or (run-hook-with-args-until-success 'doom-real-buffer-functions buf) (not (or (doom-popup-p buf) (minibufferp buf) - (string-match-p "^\\s-*\\*" (buffer-name buf))))))) + (string-match-p "^\\s-*\\*" (buffer-name buf)) + (not (buffer-file-name buf))))))) ;;;###autoload (defun doom/next-buffer () diff --git a/test/core/autoload/test-buffers.el b/test/core/autoload/test-buffers.el index 73b235f55..3658b9f70 100644 --- a/test/core/autoload/test-buffers.el +++ b/test/core/autoload/test-buffers.el @@ -36,6 +36,8 @@ (ert-deftest get-real-buffers () (with-temp-buffers! (a b c d) + (dolist (buf (list a b)) + (with-current-buffer buf (setq-local buffer-file-name "x"))) (with-current-buffer c (rename-buffer "*C*")) (with-current-buffer d @@ -56,7 +58,9 @@ (should-not (buffer-live-p a)))) (ert-deftest kill-buffer-then-show-real-buffer () - (with-temp-buffers! (a b c) + (with-temp-buffers! (a b c d) + (dolist (buf (list a b d)) + (with-current-buffer buf (setq-local buffer-file-name "x"))) (should (cl-every #'buffer-live-p buffer-list)) (switch-to-buffer a) (should (eq (current-buffer) a)) @@ -64,7 +68,7 @@ (should (doom-kill-buffer a)) (should (eq (current-buffer) b)) (should (doom-kill-buffer)) - (should (eq (current-buffer) c)) + (should (eq (current-buffer) d)) (doom/kill-this-buffer) (should (eq (current-buffer) (doom-fallback-buffer)))))