mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-17 11:30:28 +01:00
Speed up child processing by separating scoped from non-scoped tags
This commit is contained in:
@@ -413,13 +413,23 @@ function! s:ProcessFile(fname, ftype)
|
||||
endfor
|
||||
|
||||
if has_key(typeinfo, 'scopes') && !empty(typeinfo.scopes)
|
||||
let processedtags = []
|
||||
|
||||
let scopedtags = []
|
||||
for scope in typeinfo.scopes
|
||||
call s:AddChildren(fileinfo.tags, processedtags, '',
|
||||
let is_scoped = 'has_key(typeinfo.kind2scope, v:val.fields.kind) ||
|
||||
\ has_key(v:val.fields, scope)'
|
||||
let scopedtags += filter(copy(fileinfo.tags), is_scoped)
|
||||
call filter(fileinfo.tags, '!(' . is_scoped . ')')
|
||||
endfor
|
||||
|
||||
let processedtags = []
|
||||
for scope in typeinfo.scopes
|
||||
call s:AddChildren(scopedtags, processedtags, '',
|
||||
\ '', scope, 1, typeinfo)
|
||||
endfor
|
||||
|
||||
" 'scopedtags' can still contain some tags that don't have any
|
||||
" children
|
||||
call extend(fileinfo.tags, scopedtags)
|
||||
call extend(fileinfo.tags, processedtags)
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user