Fix bug in excluding Gstatus window from reuse

When Gstatus is the only window, executing Gdiff results in the Gstatus
being reused for the diff split.

Closes https://github.com/tpope/vim-fugitive/issues/853
This commit is contained in:
Henrique Malheiro 2019-02-02 14:42:11 +00:00 committed by Tim Pope
parent 3304c14c63
commit c98d3cf38f

View File

@ -2876,7 +2876,7 @@ endfunction
function! s:UsableWin(nr) abort
return a:nr && !getwinvar(a:nr, '&previewwindow') &&
\ (empty(getwinvar(a:nr, 'fugitive_status')) || getwinvar(a:nr, 'fugitive_type') !=# 'index') &&
\ (empty(getwinvar(a:nr, 'fugitive_status')) || getbufvar(winbufnr(a:nr), 'fugitive_type') !=# 'index') &&
\ index(['gitrebase', 'gitcommit'], getbufvar(winbufnr(a:nr), '&filetype')) < 0 &&
\ index(['nofile','help','quickfix'], getbufvar(winbufnr(a:nr), '&buftype')) < 0
endfunction