Tiny optimization to s:Slash()

References https://github.com/tpope/vim-fugitive/issues/1701
This commit is contained in:
Tim Pope
2021-03-16 15:52:37 -04:00
parent 3eb6f316c0
commit f5bbd4eea0
2 changed files with 18 additions and 13 deletions

View File

@@ -310,13 +310,15 @@ function! FugitiveGitPath(path) abort
return s:Slash(a:path)
endfunction
function! s:Slash(path) abort
if exists('+shellslash')
if exists('+shellslash')
function! s:Slash(path) abort
return tr(a:path, '\', '/')
else
endfunction
else
function! s:Slash(path) abort
return a:path
endif
endfunction
endfunction
endif
function! s:ProjectionistDetect() abort
let file = s:Slash(get(g:, 'projectionist_file', ''))