Closed PR0BLEMCH1LD closed 1 year ago
I ended up kinda-fixing it with a custom event and closing the empty buffer:
let s:terminal_opened = 0
function! s:trigger()
if empty(filter(range(1, bufnr('$')), 'buflisted(v:val) && "terminal" ==? getbufvar(v:val, "&buftype")'))
if s:terminal_opened == 1
let s:terminal_opened = 0
if exists('#User#TerminalClose')
execute 'doautocmd User TerminalClose'
endif
endif
endif
endfunction
augroup startify_fix
autocmd!
autocmd TerminalOpen * let s:terminal_opened = 1
autocmd BufEnter * call s:trigger()
autocmd User TerminalClose if line2byte('.') == -1 && winnr('$') > 1 && empty(bufname()) | execute winnr('#') ' wincmd w' | execute 'Bdelete! nameless' | endif
augroup END
I only tested it slightly so let me know if you have the same issue and found bugs in the solution above.
Right so I found out that this was covered in the FAQs but with vim-plug.
Steps to recreate
Screenshots
Happens in vanilla vim as well