Fix save-buffer prompt occurring after buffer is buried
This commit is contained in:
parent
24bf471f55
commit
4566dea4b3
1 changed files with 12 additions and 9 deletions
|
@ -554,6 +554,9 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
|||
((eq buf (doom-fallback-buffer))
|
||||
(message "Can't kill the fallback buffer."))
|
||||
((doom-real-buffer-p buf)
|
||||
(if (and (buffer-modified-p buf)
|
||||
(not (y-or-n-p "Buffer %s is modified; kill anyway?")))
|
||||
(message "Aborted")
|
||||
(when (or ;; if there aren't more real buffers than visible buffers,
|
||||
;; then there are no real, non-visible buffers left.
|
||||
(not (cl-set-difference (doom-real-buffer-list)
|
||||
|
@ -562,7 +565,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
|||
;; returns nil), we have nowhere left to go
|
||||
(memq (previous-buffer) (list buf 'nil)))
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(kill-buffer buf))
|
||||
(kill-buffer buf)))
|
||||
(t
|
||||
(funcall orig-fn)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue