mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-15 05:53:00 +08:00
Escape quotes in path filters, closes #150
This commit is contained in:
parent
ca02374f40
commit
2ebd2a1392
|
@ -2269,7 +2269,8 @@ function! s:AddScopedTags(tags, processedtags, parent, depth,
|
|||
" alternatively in a conditional (Issue #139). The only way to
|
||||
" distinguish between them is by line number.
|
||||
let twins = filter(copy(realtags),
|
||||
\ "v:val.fullpath ==# '" . tag.fullpath . "'" .
|
||||
\ "v:val.fullpath ==# '" .
|
||||
\ substitute(tag.fullpath, "'", "''", 'g') . "'" .
|
||||
\ " && v:val.fields.line != " . tag.fields.line)
|
||||
let maxline = line('$')
|
||||
for twin in twins
|
||||
|
@ -2348,8 +2349,9 @@ function! s:ProcessPseudoChildren(tags, tag, depth, typeinfo, fileinfo) abort
|
|||
\ a:typeinfo, a:fileinfo, line('$'))
|
||||
endfor
|
||||
|
||||
let is_grandchild = 'v:val.depth > a:depth &&
|
||||
\ match(v:val.path, ''^\C'' . a:tag.fullpath) == 0'
|
||||
let is_grandchild = 'v:val.depth > a:depth && ' .
|
||||
\ 'match(v:val.path,' .
|
||||
\ '''^\C'' . substitute(a:tag.fullpath, "''", "''''", "g")) == 0'
|
||||
let grandchildren = filter(copy(a:tags), is_grandchild)
|
||||
if !empty(grandchildren)
|
||||
call s:AddScopedTags(a:tags, a:tag.children, a:tag, a:depth + 1,
|
||||
|
|
Loading…
Reference in New Issue
Block a user