From c98d3cf38f8510f2686b9dc1f17a74f0f327b0a0 Mon Sep 17 00:00:00 2001 From: Henrique Malheiro Date: Sat, 2 Feb 2019 14:42:11 +0000 Subject: [PATCH] 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 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ecde485..1423a14 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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