jtbm37 / all-the-icons-dired

Adds dired support to all-the-icons
GNU General Public License v3.0
197 stars 26 forks source link

Re: auto add icons for inserted subdirectories #33

Closed conao3 closed 4 years ago

conao3 commented 4 years ago

FYI: @mohkale

Re #28. This PR includes conflict resolve and suit currently conventions.

conao3 commented 4 years ago

This diff maybe also good.

modified   all-the-icons-dired.el
@@ -69,7 +69,6 @@
 (defun all-the-icons-dired--remove-all-overlays ()
   "Remove all `all-the-icons-dired' overlays."
   (save-restriction
-    (widen)
     (mapc #'delete-overlay
           (all-the-icons-dired--overlays-in (point-min) (point-max)))))

@@ -125,8 +124,7 @@
            (condition-case nil
                (dired-next-subdir 1)
              (error (point-max))))
-          (all-the-icons-dired--reset)
-          (all-the-icons-dired--display))
+          (all-the-icons-dired--refresh))
       (widen))))

 ;;;###autoload
mohkale commented 4 years ago

Great work 😄, is it just me or are icons for folders in subdirectories not being assigned properly

Capture

conao3 commented 4 years ago

Sorry, this is side-effect using all-the-icons-icon-for-dir from #24 and the issue is going to solve at #32.

mohkale commented 4 years ago

Actually I just fixed it, try the following diff.

diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el
index 7b9ca00..cd86a3b 100644
--- a/all-the-icons-dired.el
+++ b/all-the-icons-dired.el
@@ -79,7 +79,7 @@
   (save-excursion
     (goto-char (point-min))
     (while (not (eobp))
-      (let ((file (dired-get-filename 'verbatim t)))
+      (let ((file (dired-get-filename t t)))
         (when file
           (let ((icon (if (file-directory-p file)
                           (all-the-icons-icon-for-dir file nil "")
conao3 commented 4 years ago

Really? The diff did not solve the face problem in my local environment...

mohkale commented 4 years ago

Really? working from your branch, and applying the diff changes the above image into

Capture

now subfolders have the correct (folder) icon applied to them, instead of having the blank (page) icon.

Is that not happening for you?

conao3 commented 4 years ago

I get it! I misunderstood your mentioned issue! Certainly, the directory icon in the dired was broken and I needed your diff to fix it. I thought you pointed out that the color of the icon is strange. Thanks!

mohkale commented 4 years ago

No probs, once again great work 😄. I look forward to having pretty dired sessions from now on.

mohkale commented 4 years ago

Probably worth noting, dired-insert-subdir doesn't seem to remove the icon this applies.

jtbm37 commented 4 years ago

@conao3 Thanks.

conao3 commented 4 years ago

Thanks!