Skip to content

Commit

Permalink
hack(dired): workaround for nerd-icons support in dired-subtree.
Browse files Browse the repository at this point in the history
  • Loading branch information
milanglacier committed Aug 6, 2023
1 parent 72b15f8 commit 1dadef8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions lisp/autoloads/my-loaddefs.el
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ open vterm at project root, if no root is found, open at the default-directory"
(autoload 'my/project-root-or-default-dir "my-misc-autoloads" "\
If a project root is found, return it. Otherwise return `default-directory'.")
(autoload 'my/ibuffer-vc-setup "my-misc-autoloads")
(autoload 'my:dired-subtree-toggle-nerd-icons "my-misc-autoloads")


;;; Generated autoloads from my-org-autoloads.el
Expand Down
11 changes: 11 additions & 0 deletions lisp/autoloads/my-misc-autoloads.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,16 @@
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic)))

(defun my:dired-subtree-add-nerd-icons ()
(interactive)
(revert-buffer))

;;;###autoload
(defun my:dired-subtree-toggle-nerd-icons ()
(when (require 'dired-subtree nil t)
(if nerd-icons-dired-mode
(advice-add #'dired-subtree-toggle :after #'my:dired-subtree-add-nerd-icons)
(advice-remove #'dired-subtree-toggle #'my:dired-subtree-add-nerd-icons))))

(provide 'my-misc-autoloads)
;;; my-misc-autoloads.el ends here
3 changes: 2 additions & 1 deletion lisp/my-misc.el
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@
:hook (dired-mode . diredfl-mode))

(use-package nerd-icons-dired
:hook (dired-mode . nerd-icons-dired-mode))
:hook ((dired-mode . nerd-icons-dired-mode)
(nerd-icons-dired-mode . my:dired-subtree-toggle-nerd-icons)))

(use-package dired-sidebar
:init
Expand Down

0 comments on commit 1dadef8

Please sign in to comment.