mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
mode-line: color coded vcs states + faces
This commit is contained in:
@ -233,10 +233,19 @@
|
|||||||
(t (format ":%d%%%%" perc))))))
|
(t (format ":%d%%%%" perc))))))
|
||||||
" "))
|
" "))
|
||||||
|
|
||||||
|
(defface mode-line-vcs-info nil '((t (:inherit warning))))
|
||||||
|
(defface mode-line-vcs-warning nil '((t (:inherit warning))))
|
||||||
(spaceline-define-segment *vc
|
(spaceline-define-segment *vc
|
||||||
"Version control info"
|
"Version control info"
|
||||||
(when vc-mode
|
(when vc-mode
|
||||||
(concat "⎇ " (substring vc-mode (+ 2 (length (symbol-name (vc-backend buffer-file-name))))))))
|
(propertize
|
||||||
|
(concat "⎇ " (substring vc-mode (+ 2 (length (symbol-name (vc-backend buffer-file-name))))))
|
||||||
|
'face (when active
|
||||||
|
(let ((state (vc-state buffer-file-name)))
|
||||||
|
(cond ((memq state '(edited added))
|
||||||
|
'mode-line-vcs-info)
|
||||||
|
((memq state '(removed needs-merge needs-update conflict removed unregistered))
|
||||||
|
'mode-line-vcs-warning)))))))
|
||||||
|
|
||||||
;; search indicators
|
;; search indicators
|
||||||
(defface mode-line-count-face nil "")
|
(defface mode-line-count-face nil "")
|
||||||
|
Reference in New Issue
Block a user