From f9c5f24576e82aae5ab8a5480f1ae48615354e40 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Wed, 26 Nov 2014 14:52:54 +1300 Subject: [PATCH] Don't skip over closed folds with zk --- autoload/tagbar.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 2ac0732..cfcc48a 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3346,8 +3346,14 @@ function! s:GotoPrevFold() abort if empty(taginfo) continue - elseif !empty(taginfo.parent) && taginfo.parent != curparent && - \ empty(get(taginfo, 'children', [])) + " Check for the first tag that is either: + " - the last tag in an open fold, that is skip all tags that have the + " same parent as the current one, or + " - a closed parent fold. + elseif (!empty(taginfo.parent) && taginfo.parent != curparent && + \ empty(get(taginfo, 'children', []))) || + \ ((!empty(get(taginfo, 'children', [])) || taginfo.isKindheader()) && + \ taginfo.isFolded()) let newlinenr = linenr break endif