1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 03:50:26 +01:00

Handle tags that cover multiple scopes correctly

References: #430
This commit is contained in:
Jan Larres
2017-08-20 20:07:34 +12:00
parent 02f8a922b1
commit d4c370cf0e
5 changed files with 102 additions and 15 deletions

View File

@@ -44,6 +44,11 @@ function! s:BaseTag.isPseudoTag() abort dict
return 0
endfunction
" s:BaseTag.isSplitTag {{{1
function! s:BaseTag.isSplitTag() abort dict
return 0
endfunction
" s:BaseTag.isKindheader() {{{1
function! s:BaseTag.isKindheader() abort dict
return 0

View File

@@ -1,5 +1,7 @@
let s:NormalTag = copy(g:tagbar#prototypes#basetag#BaseTag)
let g:tagbar#prototypes#normaltag#NormalTag = s:NormalTag
function! tagbar#prototypes#normaltag#new(name) abort
let newobj = copy(s:NormalTag)

View File

@@ -0,0 +1,21 @@
" A tag that was created because of a tag name that covers multiple scopes
" Inherits the fields of the "main" tag it was split from.
" May be replaced during tag processing if it appears as a normal tag later,
" just like a pseudo tag.
let s:SplitTag = copy(g:tagbar#prototypes#normaltag#NormalTag)
function! tagbar#prototypes#splittag#new(name) abort
let newobj = copy(s:SplitTag)
call newobj._init(a:name)
return newobj
endfunction
function! s:SplitTag.isSplitTag() abort dict
return 1
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1

View File

@@ -435,7 +435,7 @@ function! tagbar#types#uctags#init(supported_types) abort
\ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let type_php.sro = '\\\\'
let type_php.sro = '\\'
let type_php.kind2scope = {
\ 'c' : 'class',
\ 'n' : 'namespace',