From 3b389aed0033fd2b3d1ee9d2db7c174d28f6c44c Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 16 Jul 2011 22:14:46 +1200 Subject: [PATCH] Ignore events when jumping to a tag and opening the window, closes #17 --- autoload/tagbar.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 8f07c9f..24ec962 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1380,9 +1380,14 @@ function! s:OpenWindow(autoclose) let s:window_expanded = 1 endif + let eventignore_save = &eventignore + set eventignore=all + let openpos = g:tagbar_left ? 'topleft vertical ' : 'botright vertical ' exe 'silent keepalt ' . openpos . g:tagbar_width . 'split ' . '__Tagbar__' + let &eventignore = eventignore_save + call s:InitWindow(a:autoclose) execute 'wincmd p' @@ -2284,6 +2289,9 @@ function! s:JumpToTag(stay_in_tagbar) let tagbarwinnr = winnr() + let eventignore_save = &eventignore + set eventignore=all + " This elaborate construct will try to switch to the correct " buffer/window; if the buffer isn't currently shown in a window it will " open it in the first window with a non-special buffer in it @@ -2342,6 +2350,8 @@ function! s:JumpToTag(stay_in_tagbar) redraw + let &eventignore = eventignore_save + if a:stay_in_tagbar call s:HighlightTag() execute tagbarwinnr . 'wincmd w'