From 6279241ec394efa193dadd29e3afa29ecc50c611 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 30 Dec 2017 00:53:51 -0500 Subject: [PATCH] More reliable doom|protect-visible-buffers --- core/core-ui.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index 6abf5280c..ada667f29 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -231,7 +231,8 @@ local value, whether or not it's permanent-local. Therefore, we cycle (defun doom|protect-visible-buffers () "Don't kill the current buffer if it is visible in another window (bury it 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)