1. kien
  2. ctrlp.vim

Commits

kien  committed bccbc87 Draft

Set pos when data is empty

  • Participants
  • Parent commits 3b34cd7
  • Branches default

Comments (0)

Files changed (1)

File autoload/ctrlp.vim

View file
  • Ignore whitespace
 
 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