Просмотр исходного кода

Fix :SSave problem with wildmode

With these settings: wildmode=list and laststatus=2

When call the command :SSave and use <tab> for autocomplete, and choose any
session, then the message "Session already exists. Overwrite?  [y/n]" does not
appear on screen.

References #155.
Pedro Nicolás Gómez 10 лет назад
Родитель
Сommit
96ccdf7f15
1 измененных файлов с 10 добавлено и 11 удалено
  1. 10 11
      autoload/startify.vim

+ 10 - 11
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