Only reset '0 mark when it is the last window

We only need to reset '0 mark when our tagbar window is the last one,
otherwise, just quit the window and let the other window handle the
error that might happen on quiting Vim.
This commit is contained in:
Techlive Zheng 2012-12-01 00:05:30 +08:00 committed by Jan Larres
parent 987569e7dd
commit 0224d32eb9

View File

@ -3364,7 +3364,11 @@ function! s:QuitIfOnlyWindow() abort
if tabpagenr('$') == 1
" Before quitting Vim, delete the tagbar buffer so that
" the '0 mark is correctly set to the previous buffer.
bdelete
" Also disable autocmd on this command to avoid unnecessary
" autocmd nesting.
if winnr('$') == 1
noautocmd bdelete
endif
quit
else
close