commit ed07f9a503e53ec3ca4d5e255acb078675f2ff0e (tree)
parent c98d3cf38f8510f2686b9dc1f17a74f0f327b0a0
Author: Tim Pope <code@tpope.net>
Date: Sun, 3 Feb 2019 01:57:24 -0500
Guard against status reloading in wrong buffer
Closes https://github.com/tpope/vim-fugitive/issues/1191
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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()