diff --git a/autoload/startify.vim b/autoload/startify.vim index 4c13b49..4fd9feb 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -948,13 +948,22 @@ endfunction " Function: s:check_user_options {{{1 function! s:check_user_options(path) abort - let session = a:path . s:sep .'Session.vim' + if get(g:, 'startify_session_autoload') + let session = a:path . s:sep . 'Session.vim' + if filereadable(glob(session)) + execute 'silent bwipeout' a:path + call startify#session_delete_buffers() + execute 'source' session + return + endif - if get(g:, 'startify_session_autoload') && filereadable(glob(session)) - execute 'silent bwipeout' a:path - call startify#session_delete_buffers() - execute 'source' session - return + let session = startify#get_session_path() . startify#get_separator() . fnamemodify(getcwd(), ':t') + if filereadable(glob(session)) + execute 'silent bwipeout' a:path + call startify#session_delete_buffers() + execute 'source' session + return + endif endif if get(g:, 'startify_change_to_vcs_root') && s:cd_to_vcs_root(a:path) diff --git a/plugin/startify.vim b/plugin/startify.vim index 96bbc5a..6c90f28 100644 --- a/plugin/startify.vim +++ b/plugin/startify.vim @@ -35,8 +35,11 @@ endfunction function! s:on_vimenter() if !argc() && line2byte('$') == -1 + let session = startify#get_session_path() . startify#get_separator() . fnamemodify(getcwd(), ':t') if get(g:, 'startify_session_autoload') && filereadable('Session.vim') source Session.vim + elseif get(g:, 'startify_session_autoload') && filereadable(session) + execute 'source ' . session elseif !get(g:, 'startify_disable_at_vimenter') call startify#insane_in_the_membrane(1) endif