mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-16 11:13:01 +08:00
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:
parent
a43068e418
commit
3566907b57
|
@ -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() |
|
||||
|
|
Loading…
Reference in New Issue
Block a user