Fix window focusing

This commit is contained in:
jez 2011-01-16 16:31:05 +08:00
parent 53041fbc45
commit 9ca31e5053
1 changed files with 4 additions and 1 deletions

View File

@ -2615,12 +2615,15 @@ function! s:Tlist_Window_Toggle()
return
endif
" Store the current buffer
let current_buf = winbufnr(0)
call s:Tlist_Window_Open()
" Go back to the original window, if Tlist_GainFocus_On_ToggleOpen is not
" set
if !g:Tlist_GainFocus_On_ToggleOpen
call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
let prev_win = bufwinnr(current_buf)
exe prev_win . 'wincmd w'
endif
" Update the taglist menu