From 334d9afaedd67bc10f207ca72d6daff5ac6469cf Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 27 May 2020 23:04:29 +0800 Subject: [PATCH] Don't display icons in remote folders. See https://github.com/jtbm37/all-the-icons-dired/issues/8. --- lisp/init-dired.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/init-dired.el b/lisp/init-dired.el index cb3fbcfc6..6a36c4aa6 100644 --- a/lisp/init-dired.el +++ b/lisp/init-dired.el @@ -94,8 +94,9 @@ (defun my-all-the-icons-dired--refresh () "Display the icons of files in a dired buffer." (all-the-icons-dired--remove-all-overlays) - ;; NOTE: don't display icons it too many items - (if (<= (count-lines (point-min) (point-max)) 1000) + ;; NOTE: don't display icons in remote folders or the folder has too many items + (if (and (not (file-remote-p default-directory)) + (<= (count-lines (point-min) (point-max)) 1000)) (save-excursion (goto-char (point-min)) (while (not (eobp)) @@ -112,7 +113,7 @@ (all-the-icons-dired--add-overlay (point) " \t") (all-the-icons-dired--add-overlay (point) (concat icon "\t"))))))) (forward-line 1))) - (message "Not display icons because of too many items."))) + (message "Remote folder or too many items."))) (advice-add #'all-the-icons-dired--refresh :override #'my-all-the-icons-dired--refresh))) ;; Extra Dired functionality