Add buffer-file-name check to vcs segment #130

This commit is contained in:
Henrik Lissner 2017-06-28 11:51:36 +02:00
parent f8dde296ca
commit a04d4a6352
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -324,7 +324,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
;;
(def-modeline-segment! vcs
"Displays the current branch, colored based on its state."
(when vc-mode
(when (and vc-mode buffer-file-name)
(let ((backend (vc-backend buffer-file-name))
(state (vc-state buffer-file-name))
(face 'mode-line-inactive)