Ignore events when jumping to a tag and opening the window, closes #17

This commit is contained in:
Jan Larres 2011-07-16 22:14:46 +12:00
parent 96d0050ea4
commit 3b389aed00

View File

@ -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'