lambdalisue / vim-fern-git-status

🌿 Add Git status badge integration on file:// scheme on fern.vim
MIT License
87 stars 6 forks source link

Windows msys2 not work #21

Open bstaint opened 2 years ago

bstaint commented 2 years ago

https://github.com/lambdalisue/fern-git-status.vim/blob/151336335d3b6975153dad77e60049ca7111da8e/autoload/fern_git_status.vim#L60

  echom a:status_map  " {'E:\Downloads\testc/1.cxx': '??''}
  echom path  " /E:/Downloads/testc/1.c
bstaint commented 2 years ago

patch:

diff --git a/autoload/fern_git_status/investigator.vim b/autoload/fern_git_status/investigator.vim
index 2e7ad6a..57e2ded 100644
--- a/autoload/fern_git_status/investigator.vim
+++ b/autoload/fern_git_status/investigator.vim
@@ -64,8 +64,9 @@ endfunction

 function! s:prepend_toplevel(toplevel, statuses) abort
   " return map(a:statuses, { _, v -> [a:toplevel . '/' . v[0], v[1]] })
+  let toplevel = has('win32') ? fern#internal#filepath#to_slash(a:toplevel) : a:toplevel
   let Profile = fern#profile#start('fern_git_status#investigator#s:prepend_toplevel')
-  return s:AsyncLambda.map(a:statuses, { v -> [a:toplevel . '/' . v[0], v[1]] })
+  return s:AsyncLambda.map(a:statuses, { v -> [toplevel . '/' . v[0], v[1]] })
        \.finally({ -> Profile() })
 endfunction