wyuenho / all-the-icons-dired

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

Case sensitive matching #3

Closed jacobilsoe closed 3 years ago

jacobilsoe commented 3 years ago

It seems filename matching is case sensitive when using all-the-icons-dired.

a.pdf shows a PDF icon whereas a.PDF shows the default icon.

If I just call all-the-icons-icon-for-file manually it returns the PDF icon for both a.pdf and a.PDF.

wyuenho commented 3 years ago
(defun all-the-icons-dired--refresh ()
  "Display the icons of files in a dired buffer."
  (all-the-icons-dired--remove-all-overlays)
  (save-excursion
    (goto-char (point-min))
    (while (not (eobp))
      (when (dired-move-to-filename nil)
        (let ((case-fold-search t))
          (when-let* ((file (dired-get-filename 'relative 'noerror))
                      (icon (if (file-directory-p file)
                                (all-the-icons-icon-for-dir file
                                                            :face 'all-the-icons-dired-dir-face
                                                            :v-adjust all-the-icons-dired-v-adjust)
                              (apply 'all-the-icons-icon-for-file file
                                     (append
                                      `(:v-adjust ,all-the-icons-dired-v-adjust)
                                      (when all-the-icons-dired-monochrome
                                        `(:face ,(face-at-point))))))))
            (if (member file '("." ".."))
                (all-the-icons-dired--add-overlay (point) "  \t")
              (all-the-icons-dired--add-overlay (point) (concat icon "\t"))))))
      (forward-line 1))))

Does this work for you?

jacobilsoe commented 3 years ago

Nope, same behaviour.

wyuenho commented 3 years ago

Sorry case-fold-search should be set to t. Try that.

jacobilsoe commented 3 years ago

Yes, I actually just tried it before you wrote. :smile: It works setting it to t.