From ba0b3163ca5cdcecf90c5a22dc6bffb332385b73 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 6 Sep 2023 16:17:16 -0400 Subject: [PATCH] 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 --- autoload/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index c5138f0..21f0053 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4341,7 +4341,7 @@ function! s:ReloadTabStatus() abort while winnr <= winnr('$') if getbufvar(winbufnr(winnr), 'fugitive_type') ==# 'index' if winnr != winnr() - execute winnr.'wincmd w' + execute 'noautocmd' winnr.'wincmd w' let restorewinnr = 1 endif try @@ -4349,7 +4349,7 @@ function! s:ReloadTabStatus() abort finally if exists('restorewinnr') unlet restorewinnr - wincmd p + noautocmd wincmd p endif endtry endif