mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 07:43:44 -05:00
Accept both fugitive://C:/ and fugitive:///C:/ on win32
The 2 slash version slots the drive letter into the host field, which I'm worried will cause problems when the URLs are used non-opaquely, for example, with an LSP. Let's start transitioning to the convention used by file:// URLs.
This commit is contained in:
@@ -139,10 +139,12 @@ function! s:Mods(mods, ...) abort
|
||||
endfunction
|
||||
|
||||
if exists('+shellslash')
|
||||
let s:dir_commit_file = '\c^fugitive://\%(/\a\@=\)\=\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$'
|
||||
function! s:Slash(path) abort
|
||||
return tr(a:path, '\', '/')
|
||||
endfunction
|
||||
else
|
||||
let s:dir_commit_file = '\c^fugitive://\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$'
|
||||
function! s:Slash(path) abort
|
||||
return a:path
|
||||
endfunction
|
||||
@@ -1606,7 +1608,7 @@ call s:add_methods('repo',['config', 'user'])
|
||||
" Section: File API
|
||||
|
||||
function! s:DirCommitFile(path) abort
|
||||
let vals = matchlist(s:Slash(a:path), '\c^fugitive://\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$')
|
||||
let vals = matchlist(s:Slash(a:path), s:dir_commit_file)
|
||||
if empty(vals)
|
||||
return ['', '', '']
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user