More reliable doom|protect-visible-buffers

This commit is contained in:
Henrik Lissner 2017-12-30 00:53:51 -05:00
parent 37a07c79b7
commit 6279241ec3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -231,7 +231,8 @@ local value, whether or not it's permanent-local. Therefore, we cycle
(defun doom|protect-visible-buffers () (defun doom|protect-visible-buffers ()
"Don't kill the current buffer if it is visible in another window (bury it "Don't kill the current buffer if it is visible in another window (bury it
instead)." instead)."
(not (and after-init-time (get-buffer-window nil t)))) (not (delq (selected-window)
(get-buffer-window-list nil nil t))))
(add-hook 'kill-buffer-query-functions #'doom|protect-visible-buffers) (add-hook 'kill-buffer-query-functions #'doom|protect-visible-buffers)