瀏覽代碼

Fix the use of s:numfiles

Marco Hinz 12 年之前
父節點
當前提交
cede7aec39
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      autoload/startify.vim

+ 3 - 1
autoload/startify.vim

@@ -181,6 +181,7 @@ endfunction
 " Function: s:show_dir {{{1
 function! s:show_dir(cnt) abort
   let cnt   = a:cnt
+  let num   = s:numfiles
   let files = []
 
   for fname in split(glob('.\=*'))
@@ -205,8 +206,9 @@ function! s:show_dir(cnt) abort
     execute 'nnoremap <buffer>' index ':edit' fnameescape(fname) '<cr>'
 
     let cnt += 1
+    let num -= 1
 
-    if (cnt == s:numfiles)
+    if !num
       break
     endif
   endfor