mirror of
https://github.com/preservim/tagbar.git
synced 2024-11-26 18:33:36 +08:00
Ignore events when jumping to a tag and opening the window, closes #17
This commit is contained in:
parent
96d0050ea4
commit
3b389aed00
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue
Block a user