summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/dired.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 2bcb28a0e00..4a4ecc901c4 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2728,7 +2728,8 @@ directory in another window."
(defun dired--find-possibly-alternative-file (file)
"Find FILE, but respect `dired-kill-when-opening-new-dired-buffer'."
(if (and dired-kill-when-opening-new-dired-buffer
- (file-directory-p file))
+ (file-directory-p file)
+ (< (length (get-buffer-window-list)) 2))
(progn
(set-buffer-modified-p nil)
(dired--find-file #'find-alternate-file file))