Browse Source

check if session dir contains files

Mike Anderson 12 years ago
parent
commit
b4b0dbae22
1 changed files with 4 additions and 0 deletions
  1. 4 0
      autoload/startify.vim

+ 4 - 0
autoload/startify.vim

@@ -37,6 +37,10 @@ function! startify#delete_session(...) abort
     echo 'The session directory does not exist: '. g:startify_session_dir
     return
   endif
+  if strlen(startify#get_session_names_as_string('')) == 0
+    echo 'There are no sessions...'
+    return
+  endif
   let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
         \ ? a:1
         \ : input('Delete this session: ', '', 'custom,startify#get_session_names_as_string'))