소스 검색

Check for empty buffer on VimEnter

We check if files were given on the command-line already, but argc() is 0 when
Vim is used as a $MANPAGER.

So, only run Startify if the first buffer is actually empty.

Fixes #310
Marco Hinz 8 년 전
부모
커밋
532f3db6be
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      plugin/startify.vim

+ 1 - 1
plugin/startify.vim

@@ -33,7 +33,7 @@ function! s:update_oldfiles(file)
 endfunction
 
 function! s:on_vimenter()
-  if !argc()
+  if !argc() && line2byte('$') == -1
     if get(g:, 'startify_session_autoload') && filereadable('Session.vim')
       source Session.vim
     elseif !get(g:, 'startify_disable_at_vimenter')