Simplify some wincmd calls

This commit is contained in:
Jan Larres 2011-10-14 17:33:52 +13:00
parent 7163f4e4fa
commit 849fcbcd5a

View File

@ -821,11 +821,11 @@ function! s:RestoreSession()
call s:InitWindow(g:tagbar_autoclose)
" Leave the Tagbar window and come back so the update event gets triggered
execute 'wincmd p'
wincmd p
execute tagbarwinnr . 'wincmd w'
if !in_tagbar
execute 'wincmd p'
wincmd p
endif
endfunction
@ -1398,7 +1398,7 @@ function! s:OpenWindow(autoclose)
call s:InitWindow(a:autoclose)
execute 'wincmd p'
wincmd p
" Jump back to the tagbar window if autoclose or autofocus is set. Can't
" just stay in it since it wouldn't trigger the update event
@ -2315,7 +2315,7 @@ function! s:JumpToTag(stay_in_tagbar)
" 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
execute 'wincmd p'
wincmd p
let filebufnr = bufnr(taginfo.fileinfo.fpath)
if bufnr('%') != filebufnr
let filewinnr = bufwinnr(filebufnr)
@ -2333,7 +2333,7 @@ function! s:JumpToTag(stay_in_tagbar)
" To make ctrl-w_p work we switch between the Tagbar window and the
" correct window once
execute tagbarwinnr . 'wincmd w'
execute 'wincmd p'
wincmd p
endif
" Mark current position so it can be jumped back to