From 58eb5c3b5500d50420daabf3933a4377a8381f60 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 27 Nov 2018 18:13:13 +0800 Subject: [PATCH] Don't show state icon in inactive windows. --- doom-modeline.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index b161b26..628047e 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -776,11 +776,15 @@ buffer where knowing the current project directory is important." "Combined information about the current buffer, including the current working directory, the file name, and its state (modified, read-only or non-existent)." (concat - (when (and doom-modeline-icon doom-modeline-major-mode-icon) - (or doom-modeline--buffer-file-icon (doom-modeline-update-buffer-file-icon))) + ;; major mode icon + (if (and doom-modeline-icon doom-modeline-major-mode-icon) + (or doom-modeline--buffer-file-icon (doom-modeline-update-buffer-file-icon))) - (or doom-modeline--buffer-file-state-icon (doom-modeline-update-buffer-file-state-icon)) + ;; state icon + (if (doom-modeline--active) + (or doom-modeline--buffer-file-state-icon (doom-modeline-update-buffer-file-state-icon))) + ;; buffer file name (if (doom-modeline--active) (or doom-modeline--buffer-file-name (doom-modeline-update-buffer-file-name)) "%b")))