mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 21:33:53 -05:00
Generalize :GBrowse - to all temp buffers
This commit is contained in:
@@ -6240,15 +6240,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
||||
let rev = ''
|
||||
let result = fugitive#Result()
|
||||
if filereadable(get(result, 'file', ''))
|
||||
for line in readfile(result.file, 4096)
|
||||
let rev = s:fnameescape(matchstr(line, '\<https\=://[^[:space:]<>]*[^[:space:]<>.,;:"''!?]'))
|
||||
if len(rev)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if empty(rev)
|
||||
return 'echoerr ' . string('fugitive: no URL found in output of last :Git')
|
||||
endif
|
||||
let rev = s:fnameescape(result.file)
|
||||
else
|
||||
return 'echoerr ' . string('fugitive: could not find prior :Git invocation')
|
||||
endif
|
||||
elseif !exists('l:remote')
|
||||
let remote = matchstr(arg, '@\zs\%('.validremote.'\)$')
|
||||
@@ -6265,6 +6259,20 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
||||
if expanded =~? '^\a\a\+:[\/][\/]' && expanded !~? '^fugitive:'
|
||||
return s:BrowserOpen(s:Slash(expanded), a:mods, a:bang)
|
||||
endif
|
||||
if !exists('l:result')
|
||||
let result = s:TempState(empty(expanded) ? @% : expanded)
|
||||
endif
|
||||
if !empty(result) && filereadable(get(result, 'file', ''))
|
||||
for line in readfile(result.file, 4096)
|
||||
let rev = s:fnameescape(matchstr(line, '\<https\=://[^[:space:]<>]*[^[:space:]<>.,;:"''!?]'))
|
||||
if len(rev)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if empty(rev)
|
||||
return 'echoerr ' . string('fugitive: no URL found in output of :Git')
|
||||
endif
|
||||
endif
|
||||
exe s:DirCheck(dir)
|
||||
if empty(expanded)
|
||||
let bufname = s:BufName('%')
|
||||
|
||||
Reference in New Issue
Block a user