From fc8b61021d34f23aa709623befe0db7455791f3e Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 19 Feb 2019 03:05:22 +0800 Subject: [PATCH] Improve: get icons of the current buffer. --- doom-modeline-segments.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 788edee..87e87e8 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -160,8 +160,11 @@ buffer where knowing the current project directory is important." (setq doom-modeline--buffer-file-icon (when (and doom-modeline-icon doom-modeline-major-mode-icon) (let* ((height (/ all-the-icons-scale-factor 1.3)) - (icon (if buffer-file-name - (doom-modeline-icon-for-file buffer-file-name :height height) + (icon (if (and buffer-file-name + (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)))) (unless (symbolp icon) (propertize icon