From 9ca31e50537e1d10ee6ac29b42325a33ec9166f8 Mon Sep 17 00:00:00 2001 From: jez Date: Sun, 16 Jan 2011 16:31:05 +0800 Subject: [PATCH] Fix window focusing --- plugin/taglist.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/taglist.vim b/plugin/taglist.vim index 59901f6..8b82406 100644 --- a/plugin/taglist.vim +++ b/plugin/taglist.vim @@ -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