Mercurial > public > dotfiles
comparison vim/vimfiles/autoload/ctrlp/dir.vim @ 3:92af3257a261
Update to latest ctrlp.vim.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 04 Jan 2012 19:37:22 -0600 |
parents | 48859d9c82c5 |
children |
comparison
equal
deleted
inserted
replaced
2:611e13daeafb | 3:92af3257a261 |
---|---|
9 fini | 9 fini |
10 en | 10 en |
11 let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0] | 11 let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0] |
12 | 12 |
13 let s:ars = [ | 13 let s:ars = [ |
14 \ 's:folsym', | |
15 \ 's:dotfiles', | |
16 \ 's:maxdepth', | 14 \ 's:maxdepth', |
17 \ 's:maxfiles', | 15 \ 's:maxfiles', |
18 \ 's:compare_lim', | 16 \ 's:compare_lim', |
19 \ 's:glob', | 17 \ 's:glob', |
18 \ 's:usrign', | |
20 \ ] | 19 \ ] |
21 | 20 |
22 let s:dir_var = ['ctrlp#dir#init('.join(s:ars, ', ').')', 'ctrlp#dir#accept', | 21 let s:dir_var = ['ctrlp#dir#init('.join(s:ars, ', ').')', 'ctrlp#dir#accept', |
23 \ 'dirs', 'dir'] | 22 \ 'dirs', 'dir'] |
24 | 23 |
27 | 26 |
28 let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) | 27 let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) |
29 " Utilities {{{1 | 28 " Utilities {{{1 |
30 fu! s:globdirs(dirs, depth) | 29 fu! s:globdirs(dirs, depth) |
31 let entries = split(globpath(a:dirs, s:glob), "\n") | 30 let entries = split(globpath(a:dirs, s:glob), "\n") |
32 if !s:folsym | 31 if s:usrign != '' |
33 let entries = filter(entries, 'getftype(v:val) != "link"') | 32 cal filter(entries, 'v:val !~ s:usrign') |
34 en | 33 en |
35 let ftrfunc = s:dotfiles ? 'ctrlp#dirfilter(v:val)' : 'isdirectory(v:val)' | 34 let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1] |
36 let alldirs = filter(entries, ftrfunc) | 35 cal extend(g:ctrlp_alldirs, dirs) |
37 cal extend(g:ctrlp_alldirs, alldirs) | 36 if !empty(dirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles) |
38 let depth = a:depth + 1 | |
39 if !empty(g:ctrlp_alldirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles) | |
40 \ && depth <= s:maxdepth | 37 \ && depth <= s:maxdepth |
41 sil! cal ctrlp#progress(len(g:ctrlp_alldirs)) | 38 sil! cal ctrlp#progress(len(g:ctrlp_alldirs)) |
42 cal s:globdirs(join(alldirs, ','), depth) | 39 cal s:globdirs(join(dirs, ','), depth) |
43 en | 40 en |
44 endf | 41 endf |
45 | 42 |
46 fu! s:max(len, max) | 43 fu! s:max(len, max) |
47 retu a:max && a:len > a:max ? 1 : 0 | 44 retu a:max && a:len > a:max ? 1 : 0 |