mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
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:
@@ -5497,6 +5497,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
|||||||
let type = 'blob'
|
let type = 'blob'
|
||||||
endif
|
endif
|
||||||
let path = path[1:-1]
|
let path = path[1:-1]
|
||||||
|
elseif full =~? '^\a\a\+:[\/][\/]'
|
||||||
|
let path = s:Slash(full)
|
||||||
|
let type = 'url'
|
||||||
elseif empty(s:Tree(dir))
|
elseif empty(s:Tree(dir))
|
||||||
let path = '.git/' . full[strlen(dir)+1:-1]
|
let path = '.git/' . full[strlen(dir)+1:-1]
|
||||||
let type = ''
|
let type = ''
|
||||||
@@ -5635,6 +5638,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
|||||||
\ 'line1': line1,
|
\ 'line1': line1,
|
||||||
\ 'line2': line2}
|
\ 'line2': line2}
|
||||||
|
|
||||||
|
if type ==# 'url'
|
||||||
|
let url = path
|
||||||
|
else
|
||||||
let url = ''
|
let url = ''
|
||||||
for Handler in get(g:, 'fugitive_browse_handlers', [])
|
for Handler in get(g:, 'fugitive_browse_handlers', [])
|
||||||
let url = call(Handler, [copy(opts)])
|
let url = call(Handler, [copy(opts)])
|
||||||
@@ -5642,6 +5648,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
if empty(url)
|
if empty(url)
|
||||||
call s:throw("No Gbrowse handler installed for '".raw."'")
|
call s:throw("No Gbrowse handler installed for '".raw."'")
|
||||||
|
|||||||
Reference in New Issue
Block a user