Skip to content

Commit fb6118b

Browse files
committed
Rephrase prompts for automatic session save/restore
I hardly ever see the prompts emitted by the vim-session plug-in because I've configured everything to work the way I want it to automatically, but while updating the screenshots of the prompts in response to issue #117 I noticed that the phrasing of the prompts could be improved, hence this change. See also issue 117 on GitHub: #117
1 parent c7ea852 commit fb6118b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

autoload/xolox/session.vim

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
" Last Change: March 15, 2015
55
" URL: http://peterodding.com/code/vim/session/
66

7-
let g:xolox#session#version = '2.10'
7+
let g:xolox#session#version = '2.10.1'
88

99
" Public API for session persistence. {{{1
1010

@@ -671,7 +671,7 @@ function! xolox#session#close_cmd(bang, silent, save_allowed, command) abort " {
671671
let name = xolox#session#find_current_session()
672672
if name != ''
673673
if a:save_allowed
674-
let msg = "Do you want to save your current %s before closing it?"
674+
let msg = "Do you want to save your %s before closing it?"
675675
let label = xolox#session#get_label(name, !is_all_tabs)
676676
if s:prompt(printf(msg, label), ["&Save", "&Don't Save"], 'g:session_autosave') == 1
677677
call xolox#session#save_cmd(name, a:bang, a:command)
@@ -946,7 +946,15 @@ function! xolox#session#get_label(name, is_tab_scoped) " {{{2
946946
" name of a session. The first argument is the name (a string) and the
947947
" second argument is a boolean indicating the scope of the session; 1 (true)
948948
" means tab scoped and 0 (false) means global scope. Returns a string.
949-
return printf('%s session %s', a:is_tab_scoped ? 'tab scoped' : 'global', string(a:name))
949+
if a:name == g:session_default_name
950+
let description = 'default editing session'
951+
else
952+
let description = printf('editing session %s', string(a:name))
953+
endif
954+
if a:is_tab_scoped
955+
let description = printf('tab scoped %s', description)
956+
endif
957+
return description
950958
endfunction
951959

952960
function! xolox#session#options_include(value) " {{{2

0 commit comments

Comments
 (0)