From 96ccdf7f15bec6ea5dba6ba5dadda6e7b85e9136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Nicol=C3=A1s=20G=C3=B3mez?= Date: Thu, 16 Apr 2015 10:39:02 +0200 Subject: [PATCH] Fix :SSave problem with wildmode With these settings: wildmode=list and laststatus=2 When call the command :SSave and use for autocomplete, and choose any session, then the message "Session already exists. Overwrite? [y/n]" does not appear on screen. References #155. --- autoload/startify.vim | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 455a4b5..906ac38 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -197,17 +197,16 @@ function! startify#session_save(...) abort endif endif - if exists('a:1') - let sname = a:1 - else - call inputsave() - let sname = input('Save under this session name: ', fnamemodify(v:this_session, ':t'), 'custom,startify#session_list_as_string') - call inputrestore() - redraw - if empty(sname) - echo 'You gave an empty name!' - return - endif + call inputsave() + let sname = exists('a:1') + \ ? a:1 + \ : input('Save under this session name: ', fnamemodify(v:this_session, ':t'), 'custom,startify#session_list_as_string') + \ | redraw + call inputrestore() + + if empty(sname) + echo 'You gave an empty name!' + return endif let spath = s:session_dir . s:sep . sname