From 0224d32eb9918f0dadabc6c885425bd963653815 Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Sat, 1 Dec 2012 00:05:30 +0800 Subject: [PATCH] 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. --- autoload/tagbar.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 3f8ad86..408c03e 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -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