parent
c3b316a5a1
commit
a4b8d4cd38
@ -16,23 +16,33 @@ let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
|||||||
\ ? add(g:ctrlp_ext_vars, s:tag_var) : [s:tag_var]
|
\ ? add(g:ctrlp_ext_vars, s:tag_var) : [s:tag_var]
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
||||||
|
|
||||||
|
fu! s:tagfiles()
|
||||||
|
retu filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)')
|
||||||
|
endf
|
||||||
"}}}
|
"}}}
|
||||||
" Public {{{
|
" Public {{{
|
||||||
fu! ctrlp#tag#init()
|
fu! ctrlp#tag#init()
|
||||||
if exists('s:cwd') && s:cwd == getcwd()
|
let &l:tags = join(sort(s:tagfiles()), ',')
|
||||||
|
if empty(&l:tags) | retu [] | en
|
||||||
|
if exists('s:ltags') && s:ltags == &l:tags
|
||||||
let newtags = 0
|
let newtags = 0
|
||||||
el
|
el
|
||||||
let s:cwd = getcwd()
|
let s:ltags = &l:tags
|
||||||
let newtags = 1
|
let newtags = 1
|
||||||
en
|
en
|
||||||
if ( newtags && !exists('g:ctrlp_alltags['''.s:cwd.''']') ) || g:ctrlp_newtag
|
let s:cwd = getcwd()
|
||||||
let alltags = map(taglist('.*'), 'v:val["name"]." ".v:val["filename"]')
|
if ( newtags && !exists('g:ctrlp_alltags['''.s:ltags.''']') )
|
||||||
cal extend(g:ctrlp_alltags, { s:cwd : alltags })
|
\ || g:ctrlp_newtag
|
||||||
|
let tags = taglist('^.*$')
|
||||||
|
let alltags = empty(tags) ? []
|
||||||
|
\ : map(tags, 'v:val["name"]." ".v:val["filename"]')
|
||||||
|
cal extend(g:ctrlp_alltags, { s:ltags : alltags })
|
||||||
let g:ctrlp_newtag = 0
|
let g:ctrlp_newtag = 0
|
||||||
en
|
en
|
||||||
sy match CtrlPTagFilename '\zs\t.*\ze$'
|
sy match CtrlPTagFilename '\zs\t.*\ze$'
|
||||||
hi link CtrlPTagFilename Comment
|
hi link CtrlPTagFilename Comment
|
||||||
retu g:ctrlp_alltags[s:cwd]
|
retu g:ctrlp_alltags[s:ltags]
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#tag#accept(mode, str)
|
fu! ctrlp#tag#accept(mode, str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user