Ver Fonte

Check if to be deleted session even exists

Marco Hinz há 10 anos atrás
pai
commit
57252a4a56
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      autoload/startify.vim

+ 5 - 0
autoload/startify.vim

@@ -325,6 +325,11 @@ function! startify#session_delete(bang, ...) abort
         \ | redraw
   call inputrestore()
 
+  if !filereadable(spath)
+    echomsg 'No such session: '. spath
+    return
+  endif
+
   echo 'Really delete '. spath .'? [y/n]' | redraw
   if a:bang || nr2char(getchar()) == 'y'
     if delete(spath) == 0