Improve: get icons of the current buffer.

This commit is contained in:
Vincent Zhang 2019-02-19 03:05:22 +08:00
parent 3e7df26a30
commit fc8b61021d

View file

@ -160,8 +160,11 @@ buffer where knowing the current project directory is important."
(setq doom-modeline--buffer-file-icon (setq doom-modeline--buffer-file-icon
(when (and doom-modeline-icon doom-modeline-major-mode-icon) (when (and doom-modeline-icon doom-modeline-major-mode-icon)
(let* ((height (/ all-the-icons-scale-factor 1.3)) (let* ((height (/ all-the-icons-scale-factor 1.3))
(icon (if buffer-file-name (icon (if (and buffer-file-name
(doom-modeline-icon-for-file buffer-file-name :height height) (all-the-icons-auto-mode-match?))
(doom-modeline-icon-for-file
(file-name-nondirectory buffer-file-name)
:height height)
(doom-modeline-icon-for-mode major-mode :height height)))) (doom-modeline-icon-for-mode major-mode :height height))))
(unless (symbolp icon) (unless (symbolp icon)
(propertize icon (propertize icon