File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 55; ; Author: Artur Yaroshenko <artawower@protonmail.com>
66; ; URL: https://github.com/artawower/file-info.el
77; ; Package-Requires: ((emacs "28.1") (hydra "0.15.0") (browse-at-remote "0.15.0"))
8- ; ; Version: 0.8 .0
8+ ; ; Version: 0.9 .0
99
1010; ; This program is free software; you can redistribute it and/or modify
1111; ; it under the terms of the GNU General Public License as published by
286286 (root (file-info--get-project-root)))
287287 (caddr (file-info--get-first-commit-info))))
288288
289- (defun file-info--file-icon ()
290- " Return icon for current file."
291- (when-let ((icons-available-p (fboundp 'all-the-icons-icon-for-mode ))
292- (icon-for-mode (all-the-icons-icon-for-mode major-mode :height 1.0 :v-adjust -0.05 ))
293- (icon-exist-p (stringp icon-for-mode)))
289+ (defun file-info--get-icon ()
290+ " Get icon for current major mode."
291+ (or (and (fboundp 'nerd-icons-icon-for-mode )
292+ (nerd-icons-icon-for-mode major-mode))
293+ (and (fboundp 'all-the-icons-icon-for-mode )
294+ (all-the-icons-icon-for-mode major-mode :height 1.0 :v-adjust -0.05 ))))
294295
295- (concat
296- icon-for-mode
297- " " )))
296+ (defun file-info--file-icon ()
297+ " Return formatted icon for current file."
298+ (let ((icon (file-info--get-icon)))
299+ (or (and (stringp icon) (concat icon " " ))
300+ " " )))
298301
299302(defun file-info--get-current-branch ()
300303 " Return current branch via VC."
You can’t perform that action at this time.
0 commit comments