From 0a81f95abf87170e3a3ac133b508d064e37da60a Mon Sep 17 00:00:00 2001
From: Marco Hinz <mh.codebro@gmail.com>
Date: Mon, 9 Apr 2018 14:31:53 +0200
Subject: [PATCH] Always create new buffer

Nowadays :enew won't create a new buffer if the current buffer is empty. So this
won't create an unused, empty, unnamed buffer.
---
 autoload/startify.vim | 9 ++++-----
 plugin/startify.vim   | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/autoload/startify.vim b/autoload/startify.vim
index f79990c..4540203 100644
--- a/autoload/startify.vim
+++ b/autoload/startify.vim
@@ -43,11 +43,8 @@ endfunction
 
 " Function: #insane_in_the_membrane {{{1
 function! startify#insane_in_the_membrane() abort
-  if &insertmode
-    return
-  endif
-
-  if &modified
+  " Handle vim -y, vim -M.
+  if &insertmode || !&modifiable
     return
   endif
 
@@ -59,6 +56,8 @@ function! startify#insane_in_the_membrane() abort
     endfor
   endif
 
+  noautocmd enew
+
   silent! setlocal
         \ bufhidden=wipe
         \ colorcolumn=
diff --git a/plugin/startify.vim b/plugin/startify.vim
index 105f457..2d78d4f 100644
--- a/plugin/startify.vim
+++ b/plugin/startify.vim
@@ -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 noautocmd enew | call startify#insane_in_the_membrane()
+command! -nargs=0 -bar Startify call startify#insane_in_the_membrane()
 command! -nargs=0 -bar StartifyDebug call startify#debug()
 
 nnoremap <silent><plug>(startify-open-buffers) :<c-u>call startify#open_buffers()<cr>