Factor out scope string generation.

This commit is contained in:
jez 2011-03-12 01:11:02 -05:00
parent ae3ac4a471
commit 38e99ef72c
1 changed files with 13 additions and 12 deletions

View File

@ -2205,12 +2205,7 @@ function! s:Tlist_Parse_Tagline(tag_line,ftype)
" Add the tag scope, if it is available and is configured. Tag
" scope is the last field after the 'line:<num>\t' field
if g:Tlist_Display_Tag_Scope
let tag_scopes = s:Tlist_Extract_Tag_Scope(a:tag_line)
for [extradata_name, extradata_content] in items(tag_scopes)
if !exists('g:Tlist_{a:ftype}_Show_Extras') || match(g:Tlist_{a:ftype}_Show_Extras, extradata_name) != -1
let ttxt = ttxt . ' [' . extradata_content . ']'
endif
endfor
let ttxt .= s:Tlist_Get_Scope_String(a:tag_line, a:ftype)
endif
endif
@ -2226,6 +2221,17 @@ function! s:Tlist_Parse_Tagline(tag_line,ftype)
let {fidx_tidx}_tag_name = tag_name
endfunction
function! s:Tlist_Get_Scope_String(tag_line, ftype)
let ttxt = ''
let tag_scopes = s:Tlist_Extract_Tag_Scope(a:tag_line)
for [extradata_name, extradata_content] in items(tag_scopes)
if !exists('g:Tlist_{a:ftype}_Show_Extras') || match(g:Tlist_{a:ftype}_Show_Extras, extradata_name) != -1
let ttxt = ttxt . ' [' . extradata_content . ']'
endif
endfor
return ttxt
endfunction
" Tlist_Process_File
" Get the list of tags defined in the specified file and store them
" in Vim variables. Returns the file index where the tags are stored.
@ -2431,12 +2437,7 @@ function! s:Tlist_Process_File(filename, ftype)
" Add the tag scope, if it is available and is configured. Tag
" scope is the last field after the 'line:<num>\t' field
if g:Tlist_Display_Tag_Scope
let tag_scopes = s:Tlist_Extract_Tag_Scope(a:tag_line)
for [extradata_name, extradata_content] in items(tag_scopes)
if !exists('g:Tlist_{a:ftype}_Show_Extras') || match(g:Tlist_{a:ftype}_Show_Extras, extradata_name) != -1
let ttxt = ttxt . ' [' . extradata_content . ']'
endif
endfor
let ttxt .= s:Tlist_Get_Scope_String(a:tag_line, a:ftype)
endif
endif