diff --git a/autoload/startify.vim b/autoload/startify.vim index 656a5d7..ed959d1 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -155,10 +155,16 @@ function! startify#session_save(...) abort return endif endif - let spath = s:session_dir . startify#get_separator() . (exists('a:1') - \ ? a:1 - \ : input('Save under this session name: ', fnamemodify(v:this_session, ':t'), 'custom,startify#session_list_as_string')) - \ | redraw + if exists('a:1') + let spath = s:session_dir . startify#get_separator() . a:1 + else + let i = input('Save under this session name: ', fnamemodify(v:this_session, ':t'), 'custom,startify#session_list_as_string') + redraw + if empty(i) + echo 'You gave an invalid name!' + return + endif + endif let spath = s:escape(spath) if !filereadable(spath) execute 'mksession '. spath | echo 'Session saved under: '. spath