From 664ad7fa570fb8a216e4731d0247a75bfcb44a60 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Thu, 2 May 2013 22:25:47 +0200 Subject: [PATCH] check if session dir contains files pt2 --- autoload/startify.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 93effc5..88fea58 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -36,8 +36,7 @@ function! startify#delete_session(...) abort if !isdirectory(g:startify_session_dir) echo 'The session directory does not exist: '. g:startify_session_dir return - endif - if strlen(startify#get_session_names_as_string('')) == 0 + elseif empty(startify#get_session_names_as_string('')) echo 'There are no sessions...' return endif @@ -92,6 +91,9 @@ function! startify#load_session(...) abort if !isdirectory(g:startify_session_dir) echo 'The session directory does not exist: '. g:startify_session_dir return + elseif empty(startify#get_session_names_as_string('')) + echo 'There are no sessions...' + return endif let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1') \ ? a:1