Skip to content

Commit 5357db8

Browse files
committed
Improve integration between vim-shell & vim-session (issue #11)
1 parent 4849e83 commit 5357db8

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

autoload/xolox/shell.vim

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: May 21, 2013
3+
" Last Change: May 25, 2013
44
" URL: http://peterodding.com/code/vim/shell/
55

6-
let g:xolox#shell#version = '0.12.6'
6+
let g:xolox#shell#version = '0.12.7'
77

88
if !exists('s:fullscreen_enabled')
99
let s:enoimpl = "%s() hasn't been implemented on your platform! %s"
@@ -272,6 +272,22 @@ function! xolox#shell#is_fullscreen() " {{{1
272272
return s:fullscreen_enabled
273273
endfunction
274274

275+
function! xolox#shell#persist_fullscreen() " {{{1
276+
" Return Vim commands needed to restore Vim's full-screen state.
277+
let commands = []
278+
if xolox#shell#is_fullscreen()
279+
" The vim-session plug-in persists and restores Vim's &guioptions while
280+
" the :Fullscreen command also manipulates &guioptions. This can cause
281+
" several weird interactions. To avoid this, we do some trickery here.
282+
call add(commands, "let &guioptions = " . string(&guioptions . s:go_toggled))
283+
if exists('s:stal_save')
284+
call add(commands, "let &stal = " . s:stal_save)
285+
endif
286+
call add(commands, "call xolox#shell#fullscreen()")
287+
endif
288+
return commands
289+
endfunction
290+
275291
function! xolox#shell#url_exists(url) " {{{1
276292
" Check whether a URL points to an existing resource (using Python).
277293
try

0 commit comments

Comments
 (0)