From affe9e557f66f359a71b8424dd33db6958acae00 Mon Sep 17 00:00:00 2001 From: Kien N Date: Thu, 19 Jan 2012 18:33:59 +0700 Subject: [PATCH] Fix a globing problem with MacVim Reverts the change in v1.6.7 that splitted '.*\|*' to '.*' and '*' --- autoload/ctrlp.vim | 6 ++---- autoload/ctrlp/dir.vim | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 7712168..78ff43f 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -46,6 +46,7 @@ fu! s:opts() if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en let s:maxdepth = min([s:maxdepth, 100]) let s:mxheight = max([s:mxheight, 1]) + let s:glob = s:dotfiles ? '.*\|*' : '*' let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) " Extensions let g:ctrlp_builtins = 2 @@ -226,10 +227,7 @@ fu! s:Files() endf fu! s:GlobPath(dirs, depth) - let entries = split(globpath(a:dirs, '*'), "\n") - if s:dotfiles - let entries += split(globpath(a:dirs, '.*'), "\n") - en + let entries = split(globpath(a:dirs, s:glob), "\n") let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1] cal extend(g:ctrlp_allfiles, dnf[1]) if !empty(dnf[0]) && !s:maxf(len(g:ctrlp_allfiles)) && depth <= s:maxdepth diff --git a/autoload/ctrlp/dir.vim b/autoload/ctrlp/dir.vim index 875f54e..76b2dfc 100644 --- a/autoload/ctrlp/dir.vim +++ b/autoload/ctrlp/dir.vim @@ -14,7 +14,7 @@ let s:ars = [ \ 's:maxdepth', \ 's:maxfiles', \ 's:compare_lim', - \ 's:dotfiles', + \ 's:glob', \ ] 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) " Utilities {{{1 fu! s:globdirs(dirs, depth) - let entries = split(globpath(a:dirs, '*'), "\n") - if s:dotfiles - let entries += split(globpath(a:dirs, '.*'), "\n") - en + let entries = split(globpath(a:dirs, s:glob), "\n") let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1] cal extend(g:ctrlp_alldirs, dirs) if !empty(dirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles)