Guard against status reloading in wrong buffer

Closes https://github.com/tpope/vim-fugitive/issues/1191
This commit is contained in:
Tim Pope 2019-02-03 01:57:24 -05:00
parent c98d3cf38f
commit ed07f9a503

View File

@ -1994,6 +1994,9 @@ function! s:StageSeek(info, fallback) abort
endfunction endfunction
function! s:ReloadStatus(...) abort function! s:ReloadStatus(...) abort
if get(b:, 'fugitive_type', '') !=# 'index'
return ''
endif
let original_lnum = a:0 ? a:1 : line('.') let original_lnum = a:0 ? a:1 : line('.')
let info = s:StageInfo(original_lnum) let info = s:StageInfo(original_lnum)
call fugitive#BufReadStatus() call fugitive#BufReadStatus()