New option: g:startify_session_number

Closes #268.
This commit is contained in:
Marco Hinz 2017-01-20 20:11:32 +01:00
parent b08d65a967
commit 72c51e773a
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F
2 changed files with 17 additions and 0 deletions

View file

@ -568,6 +568,11 @@ endfunction
" Function: s:show_sessions {{{1
function! s:show_sessions() abort
let limit = get(g:, 'startify_session_number', 999) - 1
if limit <= -1
return
endif
let sfiles = split(globpath(s:session_dir, '*'), '\n')
let sfiles = filter(sfiles, 'v:val !~# "__LAST__$"')
let sfiles = filter(sfiles,
@ -601,6 +606,9 @@ function! s:show_sessions() abort
endif
call s:register(line('$'), index, 'session', 'SLoad', fname)
let b:startify.entry_number += 1
if i == limit
break
endif
endfor
call append('$', '')

View file

@ -114,6 +114,7 @@ default values.
|g:startify_session_before_save|
|g:startify_session_delete_buffers|
|g:startify_session_dir|
|g:startify_session_number|
|g:startify_session_persistence|
|g:startify_session_remove_lines|
|g:startify_session_savecmds|
@ -460,6 +461,14 @@ Example:
\ 'silent !pdfreader ~/latexproject/main.pdf &'
\ ]
<
------------------------------------------------------------------------------
*g:startify_session_number*
>
let g:startify_session_number = 999
<
The maximum number of sessions to display. Makes the most sense together with
|g:startify_session_sort|.
------------------------------------------------------------------------------
*g:startify_session_sort*
>