fix(dired): preserve buffers on dirvish-find-entry-a

Fix: #8038
This commit is contained in:
Henrik Lissner 2024-09-07 13:56:23 -04:00
parent 2d3821741a
commit 1ff37f9fa4
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -124,6 +124,16 @@ Fixes #3939: unsortable dired entries on Windows."
(setq dirvish-subtree-always-show-state t)
(appendq! dirvish-attributes '(nerd-icons subtree-state)))
;; HACK: Fixes #8038. Because `dirvish-reuse-session' is unset above, when
;; walking a directory tree, previous dired buffers are killed along the
;; way, which is jarring for folks who expect to be able to switch back to
;; those buffers before their dired session ends. As long as we retain
;; those, Dirvish will still clean them up on `dirvish-quit'.
(defadvice! +dired--retain-buffers-on-dirvish-find-entry-a (fn &rest args)
:around #'dirvish-find-entry-a
(let ((dirvish-reuse-session t))
(apply fn args)))
;; HACK: Makes `dirvish-hide-details' and `dirvish-hide-cursor' accept a list
;; of symbols to instruct Dirvish in what contexts they should be enabled.
;; The accepted values are: