Make :SLoad! source last used session on Unix

Closes https://github.com/mhinz/vim-startify/issues/352
This commit is contained in:
Marco Hinz 2019-01-29 23:29:59 +01:00
parent 06f2f59d4f
commit 0459cd0952
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F
3 changed files with 15 additions and 15 deletions

View file

@ -164,7 +164,7 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
endfunction
" Function: #session_load {{{1
function! startify#session_load(...) abort
function! startify#session_load(source_last_session, ...) abort
if !isdirectory(s:session_dir)
echomsg 'The session directory does not exist: '. s:session_dir
return
@ -177,17 +177,15 @@ function! startify#session_load(...) abort
if a:0
let spath .= a:1
elseif a:source_last_session && !has('win32')
let spath .= '__LAST__'
else
if has('win32')
call inputsave()
let spath .= input(
\ 'Load this session: ',
\ fnamemodify(v:this_session, ':t'),
\ 'custom,startify#session_list_as_string') | redraw
call inputrestore()
else
let spath .= '__LAST__'
endif
call inputsave()
let spath .= input(
\ 'Load this session: ',
\ fnamemodify(v:this_session, ':t'),
\ 'custom,startify#session_list_as_string') | redraw
call inputrestore()
endif
if filereadable(spath)