diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index adc55f0..ae03ff3 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -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,