Only use QuitPre functionality if supported, closes #350

The QuitPre autocommand was introduced in Vim version 7.3.544. If Vim is
older than this then don't use the HandleOnlyWindow() functionality, so
in the case of closing the last window in a tab a user will have to
close the Tagbar window themselves.
This commit is contained in:
Jan Larres 2016-10-15 20:20:03 +13:00
parent a43068e418
commit 3566907b57

View File

@ -1044,7 +1044,9 @@ function! s:CreateAutocommands() abort
autocmd BufEnter * if expand('<amatch>') !~ '__Tagbar__.*' |
\ let s:last_alt_bufnr = bufnr('#') |
\ endif
autocmd QuitPre * let s:vim_quitting = 1
if exists('##QuitPre')
autocmd QuitPre * let s:vim_quitting = 1
endif
autocmd WinEnter * nested call s:HandleOnlyWindow()
autocmd WinEnter * if bufwinnr(s:TagbarBufName()) == -1 |
\ call s:ShrinkIfExpanded() |