mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-06 12:14:31 +08:00
Attempt to support 'noshellslash' on Windows
This commit is contained in:
@@ -92,10 +92,15 @@ let s:abstract_prototype = {}
|
|||||||
" Initialization {{{1
|
" Initialization {{{1
|
||||||
|
|
||||||
function! s:ExtractGitDir(path) abort
|
function! s:ExtractGitDir(path) abort
|
||||||
if a:path =~? '^fugitive://.*//'
|
if exists('+shellslash') && !&shellslash
|
||||||
return matchstr(a:path,'fugitive://\zs.\{-\}\ze//')
|
let path = s:gsub(a:path,'\\','/')
|
||||||
|
else
|
||||||
|
let path = a:path
|
||||||
endif
|
endif
|
||||||
let fn = fnamemodify(a:path,':s?[\/]$??')
|
if path =~? '^fugitive://.*//'
|
||||||
|
return matchstr(path,'fugitive://\zs.\{-\}\ze//')
|
||||||
|
endif
|
||||||
|
let fn = fnamemodify(path,':s?[\/]$??')
|
||||||
let ofn = ""
|
let ofn = ""
|
||||||
let nfn = fn
|
let nfn = fn
|
||||||
while fn != ofn
|
while fn != ofn
|
||||||
@@ -367,7 +372,12 @@ endfunction
|
|||||||
|
|
||||||
function! s:buffer_name() dict abort
|
function! s:buffer_name() dict abort
|
||||||
let bufname = bufname(self['#'])
|
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
|
endfunction
|
||||||
|
|
||||||
function! s:buffer_commit() dict abort
|
function! s:buffer_commit() dict abort
|
||||||
|
|||||||
Reference in New Issue
Block a user