Skip to content

Commit

Permalink
Bug fix: Disable Vim's special handling of initial, empty buffer
Browse files Browse the repository at this point in the history
See issue #28 on GitHub:
  #28
  • Loading branch information
xolox committed Jun 22, 2013
1 parent bbd1f8f commit aadb3a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions addon-info.json
@@ -0,0 +1 @@
{"vim_script_nr": 3150, "dependencies": {"vim-misc": {}}, "homepage": "http://peterodding.com/code/vim/session", "name": "vim-session"}
8 changes: 7 additions & 1 deletion autoload/xolox/session.vim
Expand Up @@ -3,7 +3,7 @@
" Last Change: June 22, 2013
" URL: http://peterodding.com/code/vim/session/

let g:xolox#session#version = '2.4'
let g:xolox#session#version = '2.4.1'

" Public API for session persistence. {{{1

Expand Down Expand Up @@ -204,6 +204,12 @@ function! s:state_filter(line) " {{{3
" when :mksession adds corresponding :argglobal and/or :argument commands
" to the session script.
return '" ' . a:line
elseif a:line =~ "^\\s*silent exe 'bwipe ' \\. s:wipebuf$"
" Disable Vim's special handling of the initial, empty buffer because it
" breaks restoring of special windows with content generated by a Vim
" plug-in. The :mksession command doesn't have this problem because it
" simply doesn't support buffers with generated contents...
return '" ' . a:line
else
return a:line
endif
Expand Down

1 comment on commit aadb3a2

@markwu
Copy link

@markwu markwu commented on aadb3a2 Jun 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit cause some troubles to me. Every time I saved a session, it will add an empty buffer in the beginning.

Please sign in to comment.