ソースを参照

Handle vim -y and vim -M better

Marco Hinz 7 年 前
コミット
888290d39a
2 ファイル変更4 行追加5 行削除
  1. 2 3
      autoload/startify.vim
  2. 2 2
      plugin/startify.vim

+ 2 - 3
autoload/startify.vim

@@ -41,10 +41,9 @@ function! startify#get_lastline() abort
 endfunction
 
 " Function: #insane_in_the_membrane {{{1
-function! startify#insane_in_the_membrane() abort
+function! startify#insane_in_the_membrane(on_vimenter) abort
   " Handle vim -y, vim -M.
-  if &insertmode
-        \ || (!&modifiable && &buftype != 'terminal' && &filetype != 'startify')
+  if a:on_vimenter && (&insertmode || !&modifiable)
     return
   endif
 

+ 2 - 2
plugin/startify.vim

@@ -37,7 +37,7 @@ function! s:on_vimenter()
     if get(g:, 'startify_session_autoload') && filereadable('Session.vim')
       source Session.vim
     elseif !get(g:, 'startify_disable_at_vimenter')
-      call startify#insane_in_the_membrane()
+      call startify#insane_in_the_membrane(1)
     endif
   endif
   if get(g:, 'startify_update_oldfiles')
@@ -60,7 +60,7 @@ command! -nargs=? -bar       -complete=customlist,startify#session_list SLoad
 command! -nargs=? -bar -bang -complete=customlist,startify#session_list SSave   call startify#session_save(<bang>0, <f-args>)
 command! -nargs=? -bar -bang -complete=customlist,startify#session_list SDelete call startify#session_delete(<bang>0, <f-args>)
 command! -nargs=0 -bar SClose call startify#session_close()
-command! -nargs=0 -bar Startify call startify#insane_in_the_membrane()
+command! -nargs=0 -bar Startify call startify#insane_in_the_membrane(0)
 command! -nargs=0 -bar StartifyDebug call startify#debug()
 
 nnoremap <silent><plug>(startify-open-buffers) :<c-u>call startify#open_buffers()<cr>