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()