parent
556bf1d507
commit
0bc6e863d6
|
@ -91,7 +91,7 @@ function! startify#insane_in_the_membrane() abort
|
||||||
endif
|
endif
|
||||||
call append('$', g:startify_header)
|
call append('$', g:startify_header)
|
||||||
|
|
||||||
let b:startify = { 'tick': 0, 'entries': {} }
|
let b:startify = { 'tick': 0, 'entries': {}, 'indices': [] }
|
||||||
|
|
||||||
if s:show_special
|
if s:show_special
|
||||||
call append('$', [s:padding_left .'[e] <empty buffer>', ''])
|
call append('$', [s:padding_left .'[e] <empty buffer>', ''])
|
||||||
|
@ -454,6 +454,8 @@ function! s:show_lists(lists) abort
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let b:startify.indices = copy(get(list, 'indices', []))
|
||||||
|
|
||||||
if type(list.type) == type('')
|
if type(list.type) == type('')
|
||||||
if has_key(list, 'header')
|
if has_key(list, 'header')
|
||||||
let s:last_message = list.header
|
let s:last_message = list.header
|
||||||
|
@ -924,7 +926,9 @@ endfunction
|
||||||
|
|
||||||
" Function: s:get_index_as_string {{{1
|
" Function: s:get_index_as_string {{{1
|
||||||
function! s:get_index_as_string(idx) abort
|
function! s:get_index_as_string(idx) abort
|
||||||
if exists('g:startify_custom_indices')
|
if !empty(b:startify.indices)
|
||||||
|
return remove(b:startify.indices, 0)
|
||||||
|
elseif exists('g:startify_custom_indices')
|
||||||
let listlen = len(g:startify_custom_indices)
|
let listlen = len(g:startify_custom_indices)
|
||||||
return (a:idx < listlen) ? g:startify_custom_indices[a:idx] : string(a:idx - listlen)
|
return (a:idx < listlen) ? g:startify_custom_indices[a:idx] : string(a:idx - listlen)
|
||||||
else
|
else
|
||||||
|
|
|
@ -151,13 +151,18 @@ This option is DEPRECATED in favor of |g:startify_lists|.
|
||||||
\ { 'type': 'commands', 'header': [' Commands'] },
|
\ { 'type': 'commands', 'header': [' Commands'] },
|
||||||
\ ]
|
\ ]
|
||||||
<
|
<
|
||||||
Startify displays lists. Each list consists of a type and an optional header.
|
Startify displays lists. Each list consists of a `type` and optionally a `header`
|
||||||
|
and custom `indices`.
|
||||||
|
|
||||||
The 'type' is either a string of a built-in type or a |Funcref|.
|
The 'type' is either a string of a built-in type or a |Funcref|.
|
||||||
|
|
||||||
The 'header' is a list of strings, whereas each string will be put on its own
|
The 'header' is a list of strings, whereas each string will be put on its own
|
||||||
line in the header.
|
line in the header.
|
||||||
|
|
||||||
|
The 'indices' is a list of strings, which act as indices for the current list.
|
||||||
|
Opposed to the global |g:startify_custom_indices|, this is limited to the
|
||||||
|
current list.
|
||||||
|
|
||||||
Built-in types:~
|
Built-in types:~
|
||||||
|
|
||||||
'files'
|
'files'
|
||||||
|
|
Loading…
Reference in a new issue