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

Fix highlighting tags in closed folds

If a tag was in a closed fold that was itself in a closed fold, and
those folds existed since the initial display (for example by using the
g:tagbar_foldlevel option), then intermediate tags could have invalid
tline values which resulted in the search pattern failing.
This commit is contained in:
Jan Larres
2012-06-23 01:30:45 +12:00
parent 9ae2b2d818
commit 44ce05fb5d

View File

@@ -1191,17 +1191,22 @@ endfunction
" s:BaseTag.getClosedParentTline() {{{3
function! s:BaseTag.getClosedParentTline() dict
let tagline = self.tline
let tagline = self.tline
let fileinfo = self.fileinfo
let parent = self.parent
while !empty(parent)
" Find the first closed parent, starting from the top of the hierarchy.
let parents = []
let curparent = self.parent
while !empty(curparent)
call add(parents, curparent)
let curparent = curparent.parent
endwhile
for parent in reverse(parents)
if parent.isFolded()
let tagline = parent.tline
break
endif
let parent = parent.parent
endwhile
endfor
return tagline
endfunction