ui/modeline: fontify project root separately

And add new doom-modeline-buffer-project-root face.
This commit is contained in:
Henrik Lissner 2018-08-22 20:55:47 +02:00
parent 4dfb84211b
commit 6282526743
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -71,6 +71,11 @@ buffers.")
"Face used for the filename part of the mode-line buffer path."
:group '+modeline)
(defface doom-modeline-buffer-project-root
'((t (:inherit doom-modeline-buffer-path)))
"Face used for the project root at the beginning of the mode-line path."
:group '+modeline)
(defface doom-modeline-buffer-modified '((t (:inherit (error bold) :background nil)))
"Face used for the 'unsaved' symbol in the mode-line."
:group '+modeline)
@ -242,9 +247,11 @@ buffers.")
'face 'doom-modeline-buffer-path))
((let* ((true-filename (file-truename buffer-file-name))
(relative-dirs (file-relative-name (file-name-directory true-filename)
(concat root "../"))))
root)))
(if (equal "./" relative-dirs) (setq relative-dirs ""))
(concat (propertize relative-dirs
(concat (propertize (concat (doom-project-name) "/")
'face 'doom-modeline-buffer-project-root)
(propertize relative-dirs
'face 'doom-modeline-buffer-path)
(propertize (file-name-nondirectory true-filename)
'face 'doom-modeline-buffer-file)))))))