From 26580bed5748f9ede83aebdc97f54b00167e0bd4 Mon Sep 17 00:00:00 2001 From: jez Date: Sun, 16 Jan 2011 17:00:47 +0800 Subject: [PATCH] Fix for focus handling when the taglist window gets closed. Give focus back to previously-focused window when taglist window gets closed while having focus. --- plugin/taglist.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/taglist.vim b/plugin/taglist.vim index e17c33c..e97fd72 100644 --- a/plugin/taglist.vim +++ b/plugin/taglist.vim @@ -2517,11 +2517,14 @@ function! s:Tlist_Window_Close() endif if winnr() == winnum - " Already in the taglist window. Close it and return + " Already in the taglist window. Close it and return. + " Store the buffer that was selected prior to the taglist buffer + let prev_buf = bufnr('#') if winbufnr(2) != -1 " If a window other than the taglist window is open, " then only close the taglist window. close + call s:Tlist_Exe_Cmd_No_Acmds(bufwinnr(prev_buf) . 'wincmd w') endif else " Goto the taglist window, close it and then come back to the