Avoid double reload of status window triggered by BufEnter

The second reload was short-circuited by a reltime() check, so no big
deal, but it does get in the way when trying to make the reload
conditional.

References: https://github.com/tpope/vim-fugitive/issues/2207
This commit is contained in:
Tim Pope
2023-09-06 16:17:16 -04:00
parent c7333f63e7
commit ba0b3163ca

View File

@@ -4341,7 +4341,7 @@ function! s:ReloadTabStatus() abort
while winnr <= winnr('$') while winnr <= winnr('$')
if getbufvar(winbufnr(winnr), 'fugitive_type') ==# 'index' if getbufvar(winbufnr(winnr), 'fugitive_type') ==# 'index'
if winnr != winnr() if winnr != winnr()
execute winnr.'wincmd w' execute 'noautocmd' winnr.'wincmd w'
let restorewinnr = 1 let restorewinnr = 1
endif endif
try try
@@ -4349,7 +4349,7 @@ function! s:ReloadTabStatus() abort
finally finally
if exists('restorewinnr') if exists('restorewinnr')
unlet restorewinnr unlet restorewinnr
wincmd p noautocmd wincmd p
endif endif
endtry endtry
endif endif