From 15f9ad6e88c33c8ea817a883a5a6eaab19143ed2 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Wed, 6 Nov 2013 13:27:16 +1300 Subject: [PATCH] Check for existence of qf var before deleting Otherwise explicit calling of QuickFixCmdPost autocmds without a preceding QuickFixCmdPre will generate an error. --- autoload/tagbar.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 2682b43..a7a9b1d 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -979,7 +979,9 @@ function! s:CreateAutocommands() abort \ s:known_files.rm(fnamemodify(expand(''), ':p')) autocmd QuickFixCmdPre * let s:tagbar_qf_active = 1 - autocmd QuickFixCmdPost * unlet s:tagbar_qf_active + autocmd QuickFixCmdPost * if exists('s:tagbar_qf_active') | + \ unlet s:tagbar_qf_active | + \ fi autocmd VimEnter * call s:CorrectFocusOnStartup() augroup END