Enable opening arbitrary URLs with :Gbrowse

This is still doing a lot of unnecessary processing looking for a
remote, but it doesn't seem to hurt anything.
This commit is contained in:
Tim Pope
2020-02-05 14:37:54 -05:00
parent 3c45ed0d13
commit df3ac9d278

View File

@@ -5497,6 +5497,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
let type = 'blob'
endif
let path = path[1:-1]
elseif full =~? '^\a\a\+:[\/][\/]'
let path = s:Slash(full)
let type = 'url'
elseif empty(s:Tree(dir))
let path = '.git/' . full[strlen(dir)+1:-1]
let type = ''
@@ -5635,6 +5638,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
\ 'line1': line1,
\ 'line2': line2}
if type ==# 'url'
let url = path
else
let url = ''
for Handler in get(g:, 'fugitive_browse_handlers', [])
let url = call(Handler, [copy(opts)])
@@ -5642,6 +5648,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
break
endif
endfor
endif
if empty(url)
call s:throw("No Gbrowse handler installed for '".raw."'")