mode-line: color coded vcs states + faces
This commit is contained in:
parent
a4060ac9f4
commit
9d0f5f247b
1 changed files with 10 additions and 1 deletions
|
@ -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 "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue