Navigation Menu

Skip to content

Commit

Permalink
Rephrase prompts for automatic session save/restore
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xolox committed Mar 15, 2015
1 parent c7ea852 commit fb6118b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions autoload/xolox/session.vim
Expand Up @@ -4,7 +4,7 @@
" Last Change: March 15, 2015
" URL: http://peterodding.com/code/vim/session/

let g:xolox#session#version = '2.10'
let g:xolox#session#version = '2.10.1'

" Public API for session persistence. {{{1

Expand Down Expand Up @@ -671,7 +671,7 @@ function! xolox#session#close_cmd(bang, silent, save_allowed, command) abort " {
let name = xolox#session#find_current_session()
if name != ''
if a:save_allowed
let msg = "Do you want to save your current %s before closing it?"
let msg = "Do you want to save your %s before closing it?"
let label = xolox#session#get_label(name, !is_all_tabs)
if s:prompt(printf(msg, label), ["&Save", "&Don't Save"], 'g:session_autosave') == 1
call xolox#session#save_cmd(name, a:bang, a:command)
Expand Down Expand Up @@ -946,7 +946,15 @@ function! xolox#session#get_label(name, is_tab_scoped) " {{{2
" name of a session. The first argument is the name (a string) and the
" second argument is a boolean indicating the scope of the session; 1 (true)
" means tab scoped and 0 (false) means global scope. Returns a string.
return printf('%s session %s', a:is_tab_scoped ? 'tab scoped' : 'global', string(a:name))
if a:name == g:session_default_name
let description = 'default editing session'
else
let description = printf('editing session %s', string(a:name))
endif
if a:is_tab_scoped
let description = printf('tab scoped %s', description)
endif
return description
endfunction

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

0 comments on commit fb6118b

Please sign in to comment.