Explorar el Código

Skip creating new buffer if current buffer is empty

This prevents buffer-local commands getting lost that were set before startify
was run. E.g. :Git which is set by fugitive.
Marco Hinz hace 7 años
padre
commit
6f621bd99a
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 3 1
      autoload/startify.vim
  2. 1 1
      plugin/startify.vim

+ 3 - 1
autoload/startify.vim

@@ -61,7 +61,9 @@ function! startify#insane_in_the_membrane() abort
     endfor
   endif
 
-  noautocmd enew
+  if line2byte('$') != -1
+    noautocmd enew
+  endif
 
   silent! setlocal
         \ bufhidden=wipe

+ 1 - 1
plugin/startify.vim

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