branch: elpa/dirvish commit 2781c59ecbbe6aeb75f68129e1ae6d374305f3b1 Author: Alex Lu <hellosimon1...@hotmail.com> Commit: Alex Lu <hellosimon1...@hotmail.com>
fix(core): ensure all preview buffers get killed on clear stage --- dirvish.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dirvish.el b/dirvish.el index 3ce350b143..0d862002f7 100644 --- a/dirvish.el +++ b/dirvish.el @@ -964,7 +964,6 @@ When PROC finishes, fill preview buffer with process result." "Update preview content of INDEX for DV." (when-let* ((window (dv-preview-window dv)) ((window-live-p window)) - (orig-bufs (buffer-list)) (ext (downcase (or (file-name-extension index) ""))) (fns (with-current-buffer (window-buffer (dv-root-window dv)) (dirvish-prop :preview-dps))) @@ -972,8 +971,8 @@ When PROC finishes, fill preview buffer with process result." for rcp = (funcall fn index ext window dv) thereis (and rcp (dirvish-preview-dispatch rcp dv))))) (setq-local other-window-scroll-buffer buf) - (set-window-buffer window buf) - (unless (memq buf orig-bufs) (push buf (dv-preview-buffers dv))))) + (cl-pushnew buf (dv-preview-buffers dv)) + (set-window-buffer window buf))) ;;;; Attributes