Fix a globing problem with MacVim

Reverts the change in v1.6.7 that splitted '.*\|*' to '.*' and '*'
This commit is contained in:
Kien N 2012-01-19 18:33:59 +07:00
parent f1c2b7a741
commit affe9e557f
2 changed files with 4 additions and 9 deletions

View File

@ -46,6 +46,7 @@ fu! s:opts()
if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en
let s:maxdepth = min([s:maxdepth, 100]) let s:maxdepth = min([s:maxdepth, 100])
let s:mxheight = max([s:mxheight, 1]) let s:mxheight = max([s:mxheight, 1])
let s:glob = s:dotfiles ? '.*\|*' : '*'
let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) let s:igntype = empty(s:usrign) ? -1 : type(s:usrign)
" Extensions " Extensions
let g:ctrlp_builtins = 2 let g:ctrlp_builtins = 2
@ -226,10 +227,7 @@ fu! s:Files()
endf endf
fu! s:GlobPath(dirs, depth) fu! s:GlobPath(dirs, depth)
let entries = split(globpath(a:dirs, '*'), "\n") let entries = split(globpath(a:dirs, s:glob), "\n")
if s:dotfiles
let entries += split(globpath(a:dirs, '.*'), "\n")
en
let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1] let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1]
cal extend(g:ctrlp_allfiles, dnf[1]) cal extend(g:ctrlp_allfiles, dnf[1])
if !empty(dnf[0]) && !s:maxf(len(g:ctrlp_allfiles)) && depth <= s:maxdepth if !empty(dnf[0]) && !s:maxf(len(g:ctrlp_allfiles)) && depth <= s:maxdepth

View File

@ -14,7 +14,7 @@ let s:ars = [
\ 's:maxdepth', \ 's:maxdepth',
\ 's:maxfiles', \ 's:maxfiles',
\ 's:compare_lim', \ 's:compare_lim',
\ 's:dotfiles', \ 's:glob',
\ ] \ ]
let s:dir_var = { let s:dir_var = {
@ -31,10 +31,7 @@ let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
" Utilities {{{1 " Utilities {{{1
fu! s:globdirs(dirs, depth) fu! s:globdirs(dirs, depth)
let entries = split(globpath(a:dirs, '*'), "\n") let entries = split(globpath(a:dirs, s:glob), "\n")
if s:dotfiles
let entries += split(globpath(a:dirs, '.*'), "\n")
en
let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1] let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1]
cal extend(g:ctrlp_alldirs, dirs) cal extend(g:ctrlp_alldirs, dirs)
if !empty(dirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles) if !empty(dirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles)