Skip to content

Commit

Permalink
fix(core): respect dirvish-preview-environment on dired preview
Browse files Browse the repository at this point in the history
  • Loading branch information
alexluigit committed Feb 8, 2025
1 parent f66cb05 commit d5606a1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions dirvish.el
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ When FORCE, ensure the preview get refreshed."
(setq dirvish--selected-window (frame-selected-window)))

(defun dirvish-winconf-change-h ()
"Restore hidden sessions on buffer switching."
"Record root window and update its UI for current dirvish session."
(let ((dv (dirvish-curr)))
(setf (dv-root-window dv) (get-buffer-window (cdr (dv-index dv))))
(dirvish-update-body-h 'force-preview-update)))
Expand Down Expand Up @@ -856,10 +856,9 @@ When FORCE, ensure the preview get refreshed."
(cond ((file-directory-p file) ; default directory previewer
(let* ((script
`(with-current-buffer
(let ((non-essential t)
(delay-mode-hooks t)
(enable-local-variables :safe)
enable-dir-local-variables)
(let ,(mapcar (lambda (env) `(,(car env) ,(cdr env)))
(remove (cons 'inhibit-message t)
dirvish-preview-environment))
(setq insert-directory-program
,insert-directory-program)
(dired-noselect ,file "-AlGh"))
Expand Down Expand Up @@ -991,9 +990,8 @@ If HEADER, set the `dirvish--header-line-fmt' instead."
(substring str-l 0 (min trim (1- (length str-l))))
"")))
(propertize
" " 'display
`((space :align-to (- (+ right right-fringe right-margin)
,(ceiling (* scale (string-width str-r)))))))
" " 'display `((space :align-to (- (+ right right-fringe right-margin)
,(ceiling (* scale len-r))))))
str-r)))))

;; Thanks to `doom-modeline'.
Expand Down

0 comments on commit d5606a1

Please sign in to comment.