commit 804957a3e621359c7e295c331b4bce54c19a84ad (tree)
parent cf88ce96c92aa156da4e4486c2adb0eccc600436
Author: Tim Pope <code@tpope.net>
Date: Tue, 3 Sep 2019 22:43:39 -0400
Make :Gbrowse global
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -5103,11 +5103,9 @@ call s:command('-buffer -bang -range=-1 -nargs=? -complete=customlist,s:BlameCom
" Section: :Gbrowse
-call s:command("-bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse", "Browse")
-
let s:redirects = {}
-function! s:BrowseCommand(line1, line2, range, count, bang, mods, reg, arg, args) abort
+function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abort
let dir = s:Dir()
exe s:DirCheck(dir)
try
@@ -5133,13 +5131,13 @@ function! s:BrowseCommand(line1, line2, range, count, bang, mods, reg, arg, args
else
let expanded = s:Expand(rev)
endif
- let cdir = FugitiveVimPath(fugitive#CommonDir(s:Dir()))
+ let cdir = FugitiveVimPath(fugitive#CommonDir(dir))
for subdir in ['tags/', 'heads/', 'remotes/']
if expanded !~# '^[./]' && filereadable(cdir . '/refs/' . subdir . expanded)
let expanded = '.git/refs/' . subdir . expanded
endif
endfor
- let full = s:Generate(expanded)
+ let full = fugitive#Find(expanded, dir)
let commit = ''
if full =~? '^fugitive:'
let [pathdir, commit, path] = s:DirCommitFile(full)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -389,3 +389,5 @@ exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject G
exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject Gdelete exe fugitive#DeleteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
+
+exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'