From b6a0ec00cd84b5fa57fd411d7a5b49268b00e4f5 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Wed, 12 Oct 2016 14:16:37 +1300 Subject: [PATCH] Only suspend Tagbar during 'grep' qf commands, closes #347 --- autoload/tagbar.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 1411591..0c4419b 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1059,10 +1059,12 @@ function! s:CreateAutocommands() abort autocmd BufDelete,BufWipeout * call \ s:known_files.rm(fnamemodify(expand(''), ':p')) - autocmd QuickFixCmdPre * let s:tagbar_qf_active = 1 - autocmd QuickFixCmdPost * if exists('s:tagbar_qf_active') | - \ unlet s:tagbar_qf_active | - \ endif + " Suspend Tagbar while grep commands are running, since we don't want + " to process files that only get loaded temporarily to search them + autocmd QuickFixCmdPre *grep* let s:tagbar_qf_active = 1 + autocmd QuickFixCmdPost *grep* if exists('s:tagbar_qf_active') | + \ unlet s:tagbar_qf_active | + \ endif autocmd VimEnter * call s:CorrectFocusOnStartup() augroup END