mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 21:33:53 -05:00
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:
@@ -3103,12 +3103,15 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
|
|||||||
let file = fugitive#Find(':', dir)
|
let file = fugitive#Find(':', dir)
|
||||||
let arg = ' +let\ w:fugitive_status=FugitiveGitDir() ' .
|
let arg = ' +let\ w:fugitive_status=FugitiveGitDir() ' .
|
||||||
\ s:fnameescape(file)
|
\ s:fnameescape(file)
|
||||||
for winnr in range(1, winnr('$'))
|
for tabnr in [tabpagenr()] + (mods =~# '\<tab\>' ? range(1, tabpagenr('$')) : [])
|
||||||
if s:cpath(file, fnamemodify(bufname(winbufnr(winnr)), ':p'))
|
let bufs = tabpagebuflist(tabnr)
|
||||||
if winnr == winnr()
|
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()
|
call s:ReloadStatus()
|
||||||
else
|
else
|
||||||
call s:ExpireStatus(dir)
|
call s:ExpireStatus(dir)
|
||||||
|
exe tabnr . 'tabnext'
|
||||||
exe winnr . 'wincmd w'
|
exe winnr . 'wincmd w'
|
||||||
endif
|
endif
|
||||||
let w:fugitive_status = dir
|
let w:fugitive_status = dir
|
||||||
@@ -3116,6 +3119,7 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
|
|||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
endfor
|
||||||
if a:count ==# 0
|
if a:count ==# 0
|
||||||
return mods . 'edit' . (a:bang ? '!' : '') . arg
|
return mods . 'edit' . (a:bang ? '!' : '') . arg
|
||||||
elseif a:bang
|
elseif a:bang
|
||||||
|
|||||||
Reference in New Issue
Block a user