Permalink
Browse files

Improve integration between vim-shell & vim-session (issue #11)

  • Loading branch information...
1 parent 4849e83 commit 5357db83a6ea4416e55a20217628c33918beef16 @xolox committed May 25, 2013
Showing with 18 additions and 2 deletions.
  1. +18 −2 autoload/xolox/shell.vim
View
@@ -1,9 +1,9 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: May 21, 2013
+" Last Change: May 25, 2013
" URL: http://peterodding.com/code/vim/shell/
-let g:xolox#shell#version = '0.12.6'
+let g:xolox#shell#version = '0.12.7'
if !exists('s:fullscreen_enabled')
let s:enoimpl = "%s() hasn't been implemented on your platform! %s"
@@ -272,6 +272,22 @@ function! xolox#shell#is_fullscreen() " {{{1
return s:fullscreen_enabled
endfunction
+function! xolox#shell#persist_fullscreen() " {{{1
+ " Return Vim commands needed to restore Vim's full-screen state.
+ let commands = []
+ if xolox#shell#is_fullscreen()
+ " The vim-session plug-in persists and restores Vim's &guioptions while
+ " the :Fullscreen command also manipulates &guioptions. This can cause
+ " several weird interactions. To avoid this, we do some trickery here.
+ call add(commands, "let &guioptions = " . string(&guioptions . s:go_toggled))
+ if exists('s:stal_save')
+ call add(commands, "let &stal = " . s:stal_save)
+ endif
+ call add(commands, "call xolox#shell#fullscreen()")
+ endif
+ return commands
+endfunction
+
function! xolox#shell#url_exists(url) " {{{1
" Check whether a URL points to an existing resource (using Python).
try

0 comments on commit 5357db8

Please sign in to comment.