mirror of
https://github.com/vale981/doom-modeline
synced 2025-03-04 17:01:39 -05:00
Use file-local-name
to get VC state (#464)
Recently the [change in vc-git in emacs](3572613550
)
broke modeline state in remote files as it prepends a string in the
beginning and cannot retrieve relative file path to pass as git command
argument.
The fix here ensures that the prefix in the beginning of the file path
doesn't break the `(vc-state)` command by passing local file name of the
remote files.
Fix #463
This commit is contained in:
parent
f5a994a52c
commit
749e860d4e
1 changed files with 2 additions and 2 deletions
|
@ -650,7 +650,7 @@ Uses `all-the-icons-octicon' to fetch the icon."
|
|||
(setq doom-modeline--vcs-icon
|
||||
(when (and vc-mode buffer-file-name)
|
||||
(let* ((backend (vc-backend buffer-file-name))
|
||||
(state (vc-state buffer-file-name backend)))
|
||||
(state (vc-state (file-local-name buffer-file-name) backend)))
|
||||
(cond ((memq state '(edited added))
|
||||
(doom-modeline-vcs-icon "git-compare" "⇆" "*" 'doom-modeline-info -0.05))
|
||||
((eq state 'needs-merge)
|
||||
|
@ -689,7 +689,7 @@ Uses `all-the-icons-octicon' to fetch the icon."
|
|||
(setq doom-modeline--vcs-text
|
||||
(when (and vc-mode buffer-file-name)
|
||||
(let* ((backend (vc-backend buffer-file-name))
|
||||
(state (vc-state buffer-file-name backend))
|
||||
(state (vc-state (file-local-name buffer-file-name) backend))
|
||||
(str (if vc-display-status
|
||||
(substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))
|
||||
"")))
|
||||
|
|
Loading…
Add table
Reference in a new issue