|
3 | 3 | " Last Change: May 25, 2013 |
4 | 4 | " URL: http://peterodding.com/code/vim/session/ |
5 | 5 |
|
6 | | -let g:xolox#session#version = '2.3.6' |
| 6 | +let g:xolox#session#version = '2.3.7' |
7 | 7 |
|
8 | 8 | " Public API for session persistence. {{{1 |
9 | 9 |
|
@@ -78,16 +78,19 @@ endfunction |
78 | 78 |
|
79 | 79 | function! xolox#session#save_fullscreen(commands) " {{{2 |
80 | 80 | 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") |
91 | 94 | endif |
92 | 95 | catch /^Vim\%((\a\+)\)\=:E117/ |
93 | 96 | " Ignore missing full-screen functionality. |
|
0 commit comments