From 987569e7dd214bd5492ce54277d6a413bb17c82b Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Fri, 30 Nov 2012 07:39:28 +0800 Subject: [PATCH] Only colse the tagbar window itself If there are other plugin windows open, close tagbar window and handle over the control to the other window. If the last file in the Vim's file arguments list has not been edited yet, normal Vim's behavior would be quit on ':q!' or twice ':q'. As our plugin window is the last window now, previously quiting on the file window will not trigger the "more files" check, but our window does. We'd better to behave the same. Currently, twice ':q' quiting would work, but ':q!' not. There is no easy way to determine whether the command being executed with a "!" or not, so this is a flaw now and we need to come up a better solution someday, but it is a progress than before. --- autoload/tagbar.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 4147798..3f8ad86 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3365,7 +3365,7 @@ function! s:QuitIfOnlyWindow() abort " Before quitting Vim, delete the tagbar buffer so that " the '0 mark is correctly set to the previous buffer. bdelete - quitall + quit else close endif