Kaynağa Gözat

new option: g:startify_skiplist_server

Before this we ignored all Vim server instances. That was a bad
decision. Apart from some weird cases, where servernames were set, it
totally slipped my attention, that gvim would always set a servername.

Sorry, for breaking this plugin for all gvim users!

I removed the check and added a configurable list of servernames to
be ignored.
Marco Hinz 12 yıl önce
ebeveyn
işleme
267c7abe72
2 değiştirilmiş dosya ile 18 ekleme ve 5 silme
  1. 10 0
      doc/startify.txt
  2. 8 5
      plugin/startify.vim

+ 10 - 0
doc/startify.txt

@@ -118,6 +118,16 @@ Example:   let g:startify_skiplist = [
              \ ]
 
 
+============-
+
+    let g:startify_skiplist_server = []
+
+Do not create the startify buffer, if this is a Vim server instance with a
+name contained in this list.
+
+Example:   let g:startify_skiplist_server = [ 'GVIM' ]
+
+
 ============-
 
     let g:startify_unlisted_buffer = 1

+ 8 - 5
plugin/startify.vim

@@ -23,7 +23,13 @@ command! -nargs=0 -bar Startify enew | call s:insane_in_the_membrane()
 
 " Function: s:insane_in_the_membrane {{{1
 function! s:insane_in_the_membrane() abort
-  setfiletype startify
+  if !empty(v:servername) && exists('g:startify_skiplist_server')
+    for servname in g:startify_skiplist_server
+      if servname == v:servername
+        return
+      endif
+    endfor
+  endif
   setlocal nonumber buftype=nofile
   if v:version >= 703
     setlocal norelativenumber
@@ -31,11 +37,8 @@ function! s:insane_in_the_membrane() abort
   if get(g:, 'startify_unlisted_buffer', 1)
     setlocal nobuflisted
   endif
-  call s:genesis()
-endfunction
+  setfiletype startify
 
-" Function: s:genesis {{{1
-function! s:genesis() abort
   call append('$', ['   startify>', '', '   [e]  <empty buffer>'])
   let cnt = 0
   let sep = startify#get_sep()