瀏覽代碼

Avoid unset w:startify_section_header_lines

Change w:startify_section_header_lines to b: to avoid it being unset on :split
and similar commands.

References #137.
Marco Hinz 11 年之前
父節點
當前提交
a8657753d6
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 3 3
      autoload/startify.vim
  2. 2 2
      syntax/startify.vim

+ 3 - 3
autoload/startify.vim

@@ -89,7 +89,7 @@ function! startify#insane_in_the_membrane() abort
     echohl None
   endif
 
-  let w:startify_section_header_lines = []
+  let b:startify_section_header_lines = []
   let s:lists = get(g:, 'startify_list_order', [
         \ ['   Most recently used files:'],
         \ 'files',
@@ -505,7 +505,7 @@ function! s:set_cursor() abort
   let movement = 2 * (s:newline > s:oldline) - 1
 
   " skip section headers lines until an entry is found
-  while index(w:startify_section_header_lines, s:newline) != -1
+  while index(b:startify_section_header_lines, s:newline) != -1
     let s:newline += movement
   endwhile
 
@@ -617,7 +617,7 @@ function! s:print_section_header() abort
   let curline = line('.')
 
   for lnum in range(curline, curline + len(s:last_message) + 1)
-    call add(w:startify_section_header_lines, lnum)
+    call add(b:startify_section_header_lines, lnum)
   endfor
 
   call append('$', s:last_message + [''])

+ 2 - 2
syntax/startify.vim

@@ -35,8 +35,8 @@ if exists('g:startify_custom_footer')
   execute 'syntax region StartifyFooter start=/\%'. startify#get_lastline() .'l/ end=/*/'
 endif
 
-if exists('w:startify_section_header_lines')
-  for line in w:startify_section_header_lines
+if exists('b:startify_section_header_lines')
+  for line in b:startify_section_header_lines
     execute 'syntax region StartifySection start=/\%'. line .'l/ end=/$/'
   endfor
 endif