From ed07f9a503e53ec3ca4d5e255acb078675f2ff0e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 3 Feb 2019 01:57:24 -0500 Subject: [PATCH] Guard against status reloading in wrong buffer Closes https://github.com/tpope/vim-fugitive/issues/1191 --- autoload/fugitive.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 1423a14..ae2ebf4 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1994,6 +1994,9 @@ function! s:StageSeek(info, fallback) abort endfunction function! s:ReloadStatus(...) abort + if get(b:, 'fugitive_type', '') !=# 'index' + return '' + endif let original_lnum = a:0 ? a:1 : line('.') let info = s:StageInfo(original_lnum) call fugitive#BufReadStatus()