Skip to content

Commit b2cdcaf

Browse files
committed
Improve integration between vim-shell & vim-session (issue xolox/vim-shell#11)
1 parent 62410ba commit b2cdcaf

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

autoload/xolox/session.vim

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Last Change: May 25, 2013
44
" URL: http://peterodding.com/code/vim/session/
55

6-
let g:xolox#session#version = '2.3.6'
6+
let g:xolox#session#version = '2.3.7'
77

88
" Public API for session persistence. {{{1
99

@@ -78,16 +78,19 @@ endfunction
7878

7979
function! xolox#session#save_fullscreen(commands) " {{{2
8080
try
81-
if xolox#shell#is_fullscreen()
82-
call add(a:commands, "if has('gui_running')")
83-
call add(a:commands, " try")
84-
call add(a:commands, " call xolox#shell#fullscreen()")
85-
" XXX Without this hack Vim on GTK doesn't restore &lines and &columns.
86-
call add(a:commands, " call feedkeys(\":set lines=" . &lines . " columns=" . &columns . "\\<CR>\")")
87-
call add(a:commands, " catch " . '/^Vim\%((\a\+)\)\=:E117/')
88-
call add(a:commands, " \" Ignore missing full-screen plug-in.")
89-
call add(a:commands, " endtry")
90-
call add(a:commands, "endif")
81+
let commands = xolox#shell#persist_fullscreen()
82+
if !empty(commands)
83+
call add(a:commands, "try")
84+
for line in commands
85+
call add(a:commands, " " . line)
86+
endfor
87+
if has('gui_running') && (has('gui_gtk') || has('gui_gtk2') || has('gui_gnome'))
88+
" Without this hack GVim on GTK doesn't preserve the window size.
89+
call add(a:commands, " call feedkeys(\":set lines=" . &lines . " columns=" . &columns . "\\<CR>\")")
90+
endif
91+
call add(a:commands, "catch " . '/^Vim\%((\a\+)\)\=:E117/')
92+
call add(a:commands, " \" Ignore missing full-screen plug-in.")
93+
call add(a:commands, "endtry")
9194
endif
9295
catch /^Vim\%((\a\+)\)\=:E117/
9396
" Ignore missing full-screen functionality.

0 commit comments

Comments
 (0)