Skip to content

Commit

Permalink
Merge pull request #331 from thiskappaisgrey/fix-all-the-icons-icon-f…
Browse files Browse the repository at this point in the history
…amily-for-file

Fix all-the-icons-icon-family-for-file returning nil
  • Loading branch information
wyuenho committed Sep 29, 2022
2 parents cab1fbe + 8dd7330 commit 51bf77d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion all-the-icons.el
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,12 @@ inserting functions."
;; Family Face Functions
(defun all-the-icons-icon-family-for-file (file)
"Get the icons font family for FILE."
(let ((icon (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)))
(let* ((ext (file-name-extension file))
(icon (or (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)
(and ext
(cdr (assoc (downcase ext)
all-the-icons-extension-icon-alist)))
all-the-icons-default-file-icon)))
(funcall (intern (format "%s-family" (car icon))))))

(defun all-the-icons-icon-family-for-mode (mode)
Expand Down

0 comments on commit 51bf77d

Please sign in to comment.