commit f41e5c96797a51d08a8bc36cb8a6fde191a0c000 (tree)
parent 9c86a7d3796ea4604c0dacac055454fa58c6f2f2
Author: Tim Pope <code@tpope.net>
Date: Mon, 8 Mar 2010 22:51:10 -0500
Attempt to support 'noshellslash' on Windows
Diffstat:
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -92,10 +92,15 @@ let s:abstract_prototype = {}
" Initialization {{{1
function! s:ExtractGitDir(path) abort
- if a:path =~? '^fugitive://.*//'
- return matchstr(a:path,'fugitive://\zs.\{-\}\ze//')
+ if exists('+shellslash') && !&shellslash
+ let path = s:gsub(a:path,'\\','/')
+ else
+ let path = a:path
+ endif
+ if path =~? '^fugitive://.*//'
+ return matchstr(path,'fugitive://\zs.\{-\}\ze//')
endif
- let fn = fnamemodify(a:path,':s?[\/]$??')
+ let fn = fnamemodify(path,':s?[\/]$??')
let ofn = ""
let nfn = fn
while fn != ofn
@@ -367,7 +372,12 @@ endfunction
function! s:buffer_name() dict abort
let bufname = bufname(self['#'])
- return bufname == '' ? '' : fnamemodify(bufname,':p')
+ let bufname = bufname == '' ? '' : fnamemodify(bufname,':p')
+ if exists('+shellslash') && !&shellslash
+ return s:gsub(bufname,'\\','/')
+ else
+ return bufname
+ endif
endfunction
function! s:buffer_commit() dict abort