From 6f621bd99a72781cf538d1cf28b07826ed17db26 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 9 Apr 2018 17:02:43 +0200 Subject: [PATCH] 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. --- autoload/startify.vim | 4 +++- plugin/startify.vim | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 03743cc..0f7c8f2 100644 --- a/autoload/startify.vim +++ b/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 diff --git a/plugin/startify.vim b/plugin/startify.vim index 2d78d4f..37e6d7b 100644 --- a/plugin/startify.vim +++ b/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')