From bf03741650aae253b9fbfdb5526d6a7b818a060d Mon Sep 17 00:00:00 2001 From: Kien N Date: Wed, 14 Dec 2011 17:46:21 +0700 Subject: [PATCH] Filter the information tags * Remove the pseudo-tags generate by ctags --- autoload/ctrlp/tag.vim | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/autoload/ctrlp/tag.vim b/autoload/ctrlp/tag.vim index 665d90c..8be9e48 100644 --- a/autoload/ctrlp/tag.vim +++ b/autoload/ctrlp/tag.vim @@ -44,6 +44,22 @@ fu! s:findcount(str) endfo retu [fnd, pos] endf + +fu! s:filter(tags) + let [nr, alltags] = [0, a:tags] + wh 0 < 1 + if alltags[nr] =~ '^!' && alltags[nr] !~ '^!_TAG_' + let nr += 1 + con + en + if alltags[nr] =~ '^!_TAG_' && len(alltags) > nr + cal remove(alltags, nr) + el + brea + en + endw + retu alltags +endf " Public {{{1 fu! ctrlp#tag#init(tagfiles) if empty(a:tagfiles) | retu [] | en @@ -51,7 +67,7 @@ fu! ctrlp#tag#init(tagfiles) let s:ltags = join(tagfiles, ',') let g:ctrlp_alltags = [] for each in tagfiles - let alltags = ctrlp#utils#readfile(each) + let alltags = s:filter(ctrlp#utils#readfile(each)) cal extend(g:ctrlp_alltags, alltags) endfo sy match CtrlPTabExtra '\zs\t.*\ze$'