fix(dired): initial pop-in for vc-state

Ref: hlissner/dirvish#1
This commit is contained in:
Henrik Lissner 2024-08-28 04:55:17 -04:00
parent a5039c4333
commit c99e9b8654
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -99,6 +99,14 @@ Fixes #3939: unsortable dired entries on Windows."
dirvish-header-line-height height)))))
(when (modulep! :ui vc-gutter)
;; HACK: Dirvish sets up the fringes for vc-state late in the startup
;; process, causing this jarring pop-in effect. This advice sets them up
;; sooner to avoid this.
;; REVIEW: Upstream this later.
(defadvice! +dired--init-fringes-a (_dir _buffer setup)
:before #'dirvish-data-for-dir
(when (and setup (memq 'vc-state dirvish-attributes))
(set-window-fringes nil 5 1)))
(push 'vc-state dirvish-attributes))
(when (modulep! +icons)