Hide buffer icons in inactive windows.

This commit is contained in:
Vincent Zhang 2018-11-15 17:24:00 +08:00
parent 561560dfe5
commit ab6ab18bc7

View file

@ -609,7 +609,8 @@ buffer where knowing the current project directory is important."
'face face)))) 'face face))))
;; ;;
(defvar-local doom-modeline-buffer-file-name "%b") (defvar-local doom-modeline-buffer-file-name
(propertize "%b" 'face 'doom-modeline-buffer-file))
(defun doom-modeline-update-buffer-file-name (&rest _) (defun doom-modeline-update-buffer-file-name (&rest _)
"Propertized variable `buffer-file-name' based on `doom-modeline-buffer-file-name-style'." "Propertized variable `buffer-file-name' based on `doom-modeline-buffer-file-name-style'."
(setq doom-modeline-buffer-file-name (setq doom-modeline-buffer-file-name
@ -639,7 +640,10 @@ buffer where knowing the current project directory is important."
(doom-modeline-def-segment buffer-info (doom-modeline-def-segment buffer-info
"Combined information about the current buffer, including the current working "Combined information about the current buffer, including the current working
directory, the file name, and its state (modified, read-only or non-existent)." directory, the file name, and its state (modified, read-only or non-existent)."
(concat (cond (buffer-read-only (let ((active (doom-modeline--active)))
(concat
(when active
(cond (buffer-read-only
(concat (doom-modeline-icon-octicon (concat (doom-modeline-icon-octicon
"lock" "lock"
:face 'doom-modeline-warning :face 'doom-modeline-warning
@ -663,10 +667,10 @@ directory, the file name, and its state (modified, read-only or non-existent)."
"fold" "fold"
:face 'doom-modeline-warning :face 'doom-modeline-warning
:v-adjust -0.05) :v-adjust -0.05)
" "))) " "))))
(if (and (doom-modeline--active) buffer-file-name ) (if (and active buffer-file-name)
doom-modeline-buffer-file-name doom-modeline-buffer-file-name
"%b"))) (propertize "%b" 'face (if active 'doom-modeline-buffer-file))))))
(doom-modeline-def-segment buffer-info-simple (doom-modeline-def-segment buffer-info-simple
"Display only the current buffer's name, but with fontification." "Display only the current buffer's name, but with fontification."