Avoid reuse of winfixbuf windows

References: https://github.com/tpope/vim-fugitive/issues/2272
This commit is contained in:
Tim Pope
2024-03-16 12:35:36 -04:00
parent 41beedabc7
commit fe4ba848ba

View File

@@ -6071,6 +6071,7 @@ endfunction
function! s:UsableWin(nr) abort
return a:nr && !getwinvar(a:nr, '&previewwindow') && !getwinvar(a:nr, '&winfixwidth') &&
\ !getwinvar(a:nr, '&winfixbuf') &&
\ (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', 'terminal'], getbufvar(winbufnr(a:nr), '&buftype')) < 0