aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorYasuhiro Matsumoto2022-03-22 11:50:12 +0900
committerYasuhiro Matsumoto2022-03-22 11:50:12 +0900
commit3f1ba868bda7fc7d34eb7829a5248094c6a41b10 (patch)
tree4533979b0e11c0701e001b918ee9e061e2ed8961
parent02d72d6a4008b0f0ef28a3bbefa67c231645fcaa (diff)
downloadctrlp.vim-3f1ba868bda7fc7d34eb7829a5248094c6a41b10.tar.gz

Ignore errors

-rw-r--r--autoload/ctrlp.vim11
-rw-r--r--doc/ctrlp.txt7
2 files changed, 14 insertions, 4 deletions
diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim
index fcb1823..db3b66e 100644
--- a/autoload/ctrlp.vim
+++ b/autoload/ctrlp.vim
@@ -425,14 +425,17 @@ fu! s:CloseCustomFuncs()
en
endf
-if has('patch-8.2-0995')
+if has('patch-8.2-0995') && get(g:, 'ctrlp_use_readdir', 1)
fu! s:GlobPath(dirs, depth)
let entries = []
let dirs = substitute(a:dirs, '\\\([%# ]\)', '\1', 'g')
for e in split(dirs, ',')
- sil let files = readdir(e, '1', {'sort': 'none'})
- if !s:showhidden | cal filter(files, 'v:val[0] != "."') | en
- let entries += map(files, 'e.s:lash.v:val')
+ try
+ let files = readdir(e, '1', {'sort': 'none'})
+ if !s:showhidden | cal filter(files, 'v:val[0] != "."') | en
+ let entries += map(files, 'e.s:lash.v:val')
+ cat
+ endt
endfo
let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1]
if &wig != '' | cal filter(dnf[1], 'glob(v:val) != ""') | en
diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt
index 82eecfc..e0e0d31 100644
--- a/doc/ctrlp.txt
+++ b/doc/ctrlp.txt
@@ -846,6 +846,13 @@ Example: >
*'g:ctrlp_brief_prompt'*
When this is set to 1, the <bs> on empty prompt exit CtrlP.
+ *'g:ctrlp_use_readdir'*
+Unlike kien/ctrlp.vim, ctrlpvim/ctrlp.vim uses readdir() instead of globpath()
+for speed. Set this option to 0 if you want to revert to the original
+behavior.
+Example: >
+ let g:ctrlp_use_readdir = 0
+<
*ctrlp-default-value*
Otherwise, you can use below to change default value.
Example: >