From 43ab14f8fe8277279acc0ea1073c02d8766766f5 Mon Sep 17 00:00:00 2001 From: Kien N Date: Sat, 18 Aug 2012 09:50:13 +0700 Subject: [PATCH] Small tweaks for tag and buffertag --- autoload/ctrlp/buffertag.vim | 14 ++++++++------ autoload/ctrlp/tag.vim | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/autoload/ctrlp/buffertag.vim b/autoload/ctrlp/buffertag.vim index 9c70b43..6465332 100644 --- a/autoload/ctrlp/buffertag.vim +++ b/autoload/ctrlp/buffertag.vim @@ -170,12 +170,14 @@ fu! s:process(fname, ftype) el let data = s:exectagsonfile(a:fname, a:ftype) let [raw, lines] = [split(data, '\n\+'), []] - for line in raw | if len(split(line, ';"')) == 2 - let parsed_line = s:parseline(line) - if parsed_line != '' - cal add(lines, parsed_line) + for line in raw + if line !~# '^!_TAG_' && len(split(line, ';"')) == 2 + let parsed_line = s:parseline(line) + if parsed_line != '' + cal add(lines, parsed_line) + en en - en | endfo + endfo let cache = { a:fname : { 'time': ftime, 'lines': lines } } cal extend(g:ctrlp_buftags, cache) en @@ -183,7 +185,7 @@ fu! s:process(fname, ftype) endf fu! s:parseline(line) - let eval = '\v^([^\t]+)\t(.+)\t\/\^?(.+)\$?\/\;\"\t(.+)\tline(no)?\:(\d+)' + let eval = '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)' let vals = matchlist(a:line, eval) if vals == [] | retu '' | en let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')] diff --git a/autoload/ctrlp/tag.vim b/autoload/ctrlp/tag.vim index 53b5d61..5609d21 100644 --- a/autoload/ctrlp/tag.vim +++ b/autoload/ctrlp/tag.vim @@ -54,11 +54,11 @@ fu! s:filter(tags) let nr = 0 wh 0 < 1 if a:tags == [] | brea | en - if a:tags[nr] =~ '^!' && a:tags[nr] !~ '^!_TAG_' + if a:tags[nr] =~ '^!' && a:tags[nr] !~# '^!_TAG_' let nr += 1 con en - if a:tags[nr] =~ '^!_TAG_' && len(a:tags) > nr + if a:tags[nr] =~# '^!_TAG_' && len(a:tags) > nr cal remove(a:tags, nr) el brea