From ae3ac4a471bc7198fd89eabe18895fd77c8244ba Mon Sep 17 00:00:00 2001 From: jez Date: Sat, 12 Mar 2011 01:04:00 -0500 Subject: [PATCH] Add mapping to toggle type data. If Tlist_WinWidth="auto", the split will be resized automatically to show the additional data. --- plugin/taglist.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugin/taglist.vim b/plugin/taglist.vim index eb20d5c..575700a 100644 --- a/plugin/taglist.vim +++ b/plugin/taglist.vim @@ -1562,6 +1562,9 @@ function! s:Tlist_Window_Init() " Create buffer local mappings for jumping to the tags and sorting the list nnoremap \ :call Tlist_Window_Jump_To_Tag('useopen') + " If more languages are required, generate this from a list of options + nnoremap m + \ :call Tlist_Window_Toggle_Extra('javascript', 'type') nnoremap o \ :call Tlist_Window_Jump_To_Tag('newwin') nnoremap p @@ -2836,6 +2839,20 @@ function! s:Tlist_Extract_Tag_Scope(tag_line) return tag_extras endfunction +function! s:Tlist_Window_Toggle_Extra(ftype, extra_name) + let index = index(g:Tlist_{a:ftype}_Show_Extras, a:extra_name) + if index == -1 + call add(g:Tlist_{a:ftype}_Show_Extras, a:extra_name) + else + unlet g:Tlist_{a:ftype}_Show_Extras[index] + endif + if s:auto_width + let g:Tlist_WinWidth = 30 + endif + call s:Tlist_Window_Update_File() + call s:Tlist_Window_Check_Width() +endfunction + " Tlist_Refresh() " Refresh the taglist function! s:Tlist_Refresh()