parent
bf85306c7f
commit
2fe12144eb
|
@ -81,7 +81,7 @@ function! startify#insane_in_the_membrane() abort
|
||||||
|
|
||||||
if get(g:, 'startify_session_detection', 1) && filereadable('Session.vim')
|
if get(g:, 'startify_session_detection', 1) && filereadable('Session.vim')
|
||||||
call append('$', [' [0] '. getcwd() . s:sep .'Session.vim', ''])
|
call append('$', [' [0] '. getcwd() . s:sep .'Session.vim', ''])
|
||||||
execute 'nnoremap <buffer> 0 :source Session.vim<cr>'
|
execute 'nnoremap <buffer> 0 :call startify#session_delete_buffers() <bar> source Session.vim<cr>'
|
||||||
let cnt = 1
|
let cnt = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -385,32 +385,23 @@ endfunction
|
||||||
" Function: s:show_sessions {{{1
|
" Function: s:show_sessions {{{1
|
||||||
function! s:show_sessions(cnt) abort
|
function! s:show_sessions(cnt) abort
|
||||||
let sfiles = split(globpath(s:session_dir, '*'), '\n')
|
let sfiles = split(globpath(s:session_dir, '*'), '\n')
|
||||||
|
|
||||||
if empty(sfiles)
|
if empty(sfiles)
|
||||||
if exists('s:last_message')
|
if exists('s:last_message')
|
||||||
unlet s:last_message
|
unlet s:last_message
|
||||||
endif
|
endif
|
||||||
return a:cnt
|
return a:cnt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('s:last_message')
|
if exists('s:last_message')
|
||||||
call s:print_section_header()
|
call s:print_section_header()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cnt = a:cnt
|
let cnt = a:cnt
|
||||||
let slen = len(sfiles)
|
for i in range(len(sfiles))
|
||||||
|
|
||||||
for i in range(slen)
|
|
||||||
let index = s:get_index_as_string(cnt)
|
let index = s:get_index_as_string(cnt)
|
||||||
|
|
||||||
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fnamemodify(sfiles[i], ':t:r'))
|
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fnamemodify(sfiles[i], ':t:r'))
|
||||||
execute 'nnoremap <buffer><silent>' index ':source' fnameescape(sfiles[i]) '<cr>'
|
execute 'nnoremap <buffer><silent>' index ':SLoad' fnamemodify(sfiles[i], ':t:r') '<cr>'
|
||||||
|
|
||||||
let cnt += 1
|
let cnt += 1
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call append('$', '')
|
call append('$', '')
|
||||||
|
|
||||||
return cnt
|
return cnt
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue