diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 42ff1ed..aea5258 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -1990,7 +1990,7 @@ endf fu! s:insertcache(str) let [data, g:ctrlp_newcache, str] = [g:ctrlp_allfiles, 1, a:str] - if strlen(str) <= strlen(data[0]) + if data == [] || strlen(str) <= strlen(data[0]) let pos = 0 elsei strlen(str) >= strlen(data[-1]) let pos = len(data) - 1