mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 07:43:44 -05:00
Don't throw error on invalid URL to FugitiveParse()
This commit is contained in:
@@ -57,6 +57,9 @@ endfunction
|
|||||||
|
|
||||||
function! FugitiveParse(...) abort
|
function! FugitiveParse(...) abort
|
||||||
let path = s:Slash(a:0 ? a:1 : @%)
|
let path = s:Slash(a:0 ? a:1 : @%)
|
||||||
|
if path !~# '^fugitive:'
|
||||||
|
return ['', '']
|
||||||
|
endif
|
||||||
let vals = matchlist(path, '\c^fugitive:\%(//\)\=\(.\{-\}\)\%(//\|::\)\(\x\{40\}\|[0-3]\)\(/.*\)\=$')
|
let vals = matchlist(path, '\c^fugitive:\%(//\)\=\(.\{-\}\)\%(//\|::\)\(\x\{40\}\|[0-3]\)\(/.*\)\=$')
|
||||||
if len(vals)
|
if len(vals)
|
||||||
return [(vals[2] =~# '^.$' ? ':' : '') . vals[2] . substitute(vals[3], '^/', ':', ''), vals[1]]
|
return [(vals[2] =~# '^.$' ? ':' : '') . vals[2] . substitute(vals[3], '^/', ':', ''), vals[1]]
|
||||||
|
|||||||
Reference in New Issue
Block a user