Ignore ignored cwd
This commit is contained in:
parent
7bbe4054de
commit
f4f5d052b9
@ -316,7 +316,9 @@ fu! ctrlp#files()
|
|||||||
let [lscmd, s:initcwd, g:ctrlp_allfiles] = [s:lsCmd(), s:dyncwd, []]
|
let [lscmd, s:initcwd, g:ctrlp_allfiles] = [s:lsCmd(), s:dyncwd, []]
|
||||||
" Get the list of files
|
" Get the list of files
|
||||||
if empty(lscmd)
|
if empty(lscmd)
|
||||||
cal s:GlobPath(s:fnesc(s:dyncwd, 'g', ','), 0)
|
if !ctrlp#igncwd(s:dyncwd)
|
||||||
|
cal s:GlobPath(s:fnesc(s:dyncwd, 'g', ','), 0)
|
||||||
|
en
|
||||||
el
|
el
|
||||||
sil! cal ctrlp#progress('Indexing...')
|
sil! cal ctrlp#progress('Indexing...')
|
||||||
try | cal s:UserCmd(lscmd)
|
try | cal s:UserCmd(lscmd)
|
||||||
@ -353,6 +355,9 @@ endf
|
|||||||
|
|
||||||
fu! s:UserCmd(lscmd)
|
fu! s:UserCmd(lscmd)
|
||||||
let [path, lscmd] = [s:dyncwd, a:lscmd]
|
let [path, lscmd] = [s:dyncwd, a:lscmd]
|
||||||
|
let do_ign =
|
||||||
|
\ type(s:usrcmd) == 4 && has_key(s:usrcmd, 'ignore') && s:usrcmd['ignore']
|
||||||
|
if do_ign && ctrlp#igncwd(s:cwd) | retu | en
|
||||||
if exists('+ssl') && &ssl
|
if exists('+ssl') && &ssl
|
||||||
let [ssl, &ssl, path] = [&ssl, 0, tr(path, '/', '\')]
|
let [ssl, &ssl, path] = [&ssl, 0, tr(path, '/', '\')]
|
||||||
en
|
en
|
||||||
@ -368,7 +373,7 @@ fu! s:UserCmd(lscmd)
|
|||||||
if exists('s:vcscmd') && s:vcscmd
|
if exists('s:vcscmd') && s:vcscmd
|
||||||
cal map(g:ctrlp_allfiles, 'tr(v:val, "/", "\\")')
|
cal map(g:ctrlp_allfiles, 'tr(v:val, "/", "\\")')
|
||||||
en
|
en
|
||||||
if type(s:usrcmd) == 4 && has_key(s:usrcmd, 'ignore') && s:usrcmd['ignore']
|
if do_ign
|
||||||
if !empty(s:usrign)
|
if !empty(s:usrign)
|
||||||
let g:ctrlp_allfiles = ctrlp#dirnfile(g:ctrlp_allfiles)[1]
|
let g:ctrlp_allfiles = ctrlp#dirnfile(g:ctrlp_allfiles)[1]
|
||||||
en
|
en
|
||||||
@ -1362,6 +1367,11 @@ fu! s:ispathitem()
|
|||||||
retu s:itemtype < 3 || ( s:itemtype > 2 && s:getextvar('type') == 'path' )
|
retu s:itemtype < 3 || ( s:itemtype > 2 && s:getextvar('type') == 'path' )
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! ctrlp#igncwd(cwd)
|
||||||
|
retu ctrlp#utils#glob(a:cwd, 0) == '' ||
|
||||||
|
\ ( s:igntype >= 0 && s:usrign(a:cwd, getftype(a:cwd)) )
|
||||||
|
endf
|
||||||
|
|
||||||
fu! ctrlp#dirnfile(entries)
|
fu! ctrlp#dirnfile(entries)
|
||||||
let [items, cwd] = [[[], []], s:dyncwd.s:lash()]
|
let [items, cwd] = [[[], []], s:dyncwd.s:lash()]
|
||||||
for each in a:entries
|
for each in a:entries
|
||||||
|
@ -54,7 +54,9 @@ fu! ctrlp#dir#init(...)
|
|||||||
let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir')
|
let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir')
|
||||||
if g:ctrlp_newdir || s:nocache() || !filereadable(cafile)
|
if g:ctrlp_newdir || s:nocache() || !filereadable(cafile)
|
||||||
let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []]
|
let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []]
|
||||||
cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0)
|
if !ctrlp#igncwd(s:cwd)
|
||||||
|
cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0)
|
||||||
|
en
|
||||||
cal ctrlp#rmbasedir(g:ctrlp_alldirs)
|
cal ctrlp#rmbasedir(g:ctrlp_alldirs)
|
||||||
if len(g:ctrlp_alldirs) <= s:compare_lim
|
if len(g:ctrlp_alldirs) <= s:compare_lim
|
||||||
cal sort(g:ctrlp_alldirs, 'ctrlp#complen')
|
cal sort(g:ctrlp_alldirs, 'ctrlp#complen')
|
||||||
|
Loading…
Reference in New Issue
Block a user