Only change the face of buffer files.

This commit is contained in:
Vincent Zhang 2019-09-05 03:30:43 +08:00
parent 5b523bef65
commit c97e06454b
2 changed files with 4 additions and 2 deletions

View file

@ -379,7 +379,9 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
;; `doom-modeline--buffer-file-name' may consume lots of CPU if it's called too frequently. ;; `doom-modeline--buffer-file-name' may consume lots of CPU if it's called too frequently.
(defun doom-modeline-update-buffer-file-name-face (&rest _) (defun doom-modeline-update-buffer-file-name-face (&rest _)
"Update the face of buffer file name in mode-line." "Update the face of buffer file name in mode-line."
(when (and doom-modeline--buffer-file-name (buffer-modified-p)) (when (and buffer-file-name
doom-modeline--buffer-file-name
(buffer-modified-p))
(setq doom-modeline--buffer-file-name (setq doom-modeline--buffer-file-name
(propertize doom-modeline--buffer-file-name 'face 'doom-modeline-buffer-modified)))) (propertize doom-modeline--buffer-file-name 'face 'doom-modeline-buffer-modified))))
(add-hook 'after-change-functions #'doom-modeline-update-buffer-file-name-face) (add-hook 'after-change-functions #'doom-modeline-update-buffer-file-name-face)

View file

@ -4,7 +4,7 @@
;; Author: Vincent Zhang <seagle0128@gmail.com> ;; Author: Vincent Zhang <seagle0128@gmail.com>
;; Homepage: https://github.com/seagle0128/doom-modeline ;; Homepage: https://github.com/seagle0128/doom-modeline
;; Version: 2.6.0 ;; Version: 2.6.1
;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0")) ;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0"))
;; Keywords: faces mode-line ;; Keywords: faces mode-line