Quellcode durchsuchen

use expand() in fname check

Fixes a check because $VIMRUNTIME gives an expanded path and v:oldfiles
does not.
Marco Hinz vor 12 Jahren
Ursprung
Commit
ddcfad47d0
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      plugin/startify.vim

+ 4 - 4
plugin/startify.vim

@@ -26,18 +26,18 @@ augroup END
 " Function: s:start {{{1
 function! s:start() abort
   setfiletype startify
-
   setlocal nonumber norelativenumber nobuflisted buftype=nofile
 
-  let cnt = 0
-
   call append('$', ['   startify>', '', '   [e]  <empty buffer>'])
+  let cnt = 0
 
   if get(g:, 'startify_show_files', 1) && !empty(v:oldfiles)
     let numfiles = get(g:, 'startify_show_files_number', 10)
     call append('$', '')
     for fname in v:oldfiles
-      if !filereadable(expand(fname)) || (fname =~# $VIMRUNTIME .'/doc') || (fname =~# 'bundle/.*/doc')
+      if !filereadable(expand(fname))
+            \ || (expand(fname) =~# $VIMRUNTIME .'/doc')
+            \ || (fname =~# 'bundle/.*/doc')
         continue
       endif
       call append('$', '   ['. cnt .']'. repeat(' ', 3 - strlen(string(cnt))) . fname)