mirror of
https://github.com/correl/doom-modeline.git
synced 2024-12-03 19:19:58 +00:00
Fix: update vcs.
This commit is contained in:
parent
c354cdde0c
commit
bd097590a2
1 changed files with 32 additions and 40 deletions
|
@ -613,10 +613,8 @@ directory, the file name, and its state (modified, read-only or non-existent)."
|
||||||
;; vcs
|
;; vcs
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(defvar-local doom-modeline--vcs nil)
|
(doom-modeline-def-segment vcs
|
||||||
(defun doom-modeline--update-vcs ()
|
"Displays the current branch, colored based on its state."
|
||||||
"Update vsc status in mode-line."
|
|
||||||
(setq doom-modeline--vcs
|
|
||||||
(when (and vc-mode buffer-file-name)
|
(when (and vc-mode buffer-file-name)
|
||||||
(let* ((backend (vc-backend buffer-file-name))
|
(let* ((backend (vc-backend buffer-file-name))
|
||||||
(state (vc-state buffer-file-name backend)))
|
(state (vc-state buffer-file-name backend)))
|
||||||
|
@ -648,13 +646,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
|
||||||
" "
|
" "
|
||||||
(propertize (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))
|
(propertize (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))
|
||||||
'face (if active face))
|
'face (if active face))
|
||||||
" "))))))
|
" ")))))
|
||||||
(add-hook 'after-save-hook #'doom-modeline--update-vcs)
|
|
||||||
(add-hook 'find-file-hook #'doom-modeline--update-vcs t)
|
|
||||||
|
|
||||||
(doom-modeline-def-segment vcs
|
|
||||||
"Displays the current branch, colored based on its state."
|
|
||||||
doom-modeline--vcs)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue