Skip to content

Commit e497a6d

Browse files
committed
BUG: No prompt for session auto-load when unloaded buffers exist.
When file marks (e.g. 'A) cause unloaded buffers to exist on startup, the question for session auto-load isn't brought up. bufnr('$') == 1 isn't a correct check; one needs to go through all existing buffers and check for listed ones that aren't the current one.
1 parent 8e124c9 commit e497a6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/xolox/session.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function! xolox#session#auto_load() " {{{2
392392
endif
393393
" Check that the user has started Vim without editing any files.
394394
let current_buffer_is_empty = (&modified == 0 && getline(1, '$') == [''])
395-
let buffer_list_is_empty = (bufnr('$') == 1 && bufname('%') == '')
395+
let buffer_list_is_empty = (bufname('%') == '' && empty(filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != ' . bufnr(''))))
396396
let buffer_list_is_persistent = (index(xolox#misc#option#split(&viminfo), '%') >= 0)
397397
if current_buffer_is_empty && (buffer_list_is_empty || buffer_list_is_persistent)
398398
" Check whether a session matching the user-specified server name exists.

0 commit comments

Comments
 (0)