Hunt other tabs for window on :tab Git

I'm not 100% sure if this is the correct (as in least surprising)
behavior, but it seems like as good of place as any to start.

Closes https://github.com/tpope/vim-fugitive/issues/1740
This commit is contained in:
Tim Pope
2021-05-02 06:41:51 -04:00
parent 8f4a23e663
commit 32b0d62663

View File

@@ -3103,12 +3103,15 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
let file = fugitive#Find(':', dir)
let arg = ' +let\ w:fugitive_status=FugitiveGitDir() ' .
\ s:fnameescape(file)
for winnr in range(1, winnr('$'))
if s:cpath(file, fnamemodify(bufname(winbufnr(winnr)), ':p'))
if winnr == winnr()
for tabnr in [tabpagenr()] + (mods =~# '\<tab\>' ? range(1, tabpagenr('$')) : [])
let bufs = tabpagebuflist(tabnr)
for winnr in range(1, tabpagewinnr(tabnr, '$'))
if s:cpath(file, fnamemodify(bufname(bufs[winnr-1]), ':p'))
if tabnr == tabpagenr() && winnr == winnr()
call s:ReloadStatus()
else
call s:ExpireStatus(dir)
exe tabnr . 'tabnext'
exe winnr . 'wincmd w'
endif
let w:fugitive_status = dir
@@ -3116,6 +3119,7 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
return ''
endif
endfor
endfor
if a:count ==# 0
return mods . 'edit' . (a:bang ? '!' : '') . arg
elseif a:bang