Skip to content

Commit

Permalink
Bug fix: Make auto-load work when 'viminfo' contains '%' (#19)
Browse files Browse the repository at this point in the history
Issue #19 on GitHub:
#19 (comment)
  • Loading branch information
xolox committed May 4, 2013
1 parent 8cc18f0 commit 166f1f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions autoload/xolox/session.vim
Expand Up @@ -3,7 +3,7 @@
" Last Change: May 4, 2013
" URL: http://peterodding.com/code/vim/session/

let g:xolox#session#version = '1.7.2'
let g:xolox#session#version = '1.7.3'

call xolox#misc#compat#check('session', 2)

Expand Down Expand Up @@ -250,7 +250,10 @@ function! xolox#session#auto_load() " {{{2
return
endif
" Check that the user has started Vim without editing any files.
if bufnr('$') == 1 && bufname('%') == '' && !&mod && getline(1, '$') == ['']
let current_buffer_is_empty = (&modified == 0 && getline(1, '$') == [''])
let buffer_list_is_empty = (bufnr('$') == 1 && bufname('%') == '')
let buffer_list_is_persistent = (index(xolox#misc#option#split(&viminfo), '%') >= 0)
if current_buffer_is_empty && (buffer_list_is_empty || buffer_list_is_persistent)
" Check whether a session matching the user-specified server name exists.
if v:servername !~ '^\cgvim\d*$'
for session in xolox#session#get_names()
Expand Down

0 comments on commit 166f1f7

Please sign in to comment.