|
1 | 1 | " Vim auto-load script |
2 | 2 | " Author: Peter Odding <peter@peterodding.com> |
3 | | -" Last Change: May 21, 2013 |
| 3 | +" Last Change: May 25, 2013 |
4 | 4 | " URL: http://peterodding.com/code/vim/shell/ |
5 | 5 |
|
6 | | -let g:xolox#shell#version = '0.12.6' |
| 6 | +let g:xolox#shell#version = '0.12.7' |
7 | 7 |
|
8 | 8 | if !exists('s:fullscreen_enabled') |
9 | 9 | let s:enoimpl = "%s() hasn't been implemented on your platform! %s" |
@@ -272,6 +272,22 @@ function! xolox#shell#is_fullscreen() " {{{1 |
272 | 272 | return s:fullscreen_enabled |
273 | 273 | endfunction |
274 | 274 |
|
| 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 | + |
275 | 291 | function! xolox#shell#url_exists(url) " {{{1 |
276 | 292 | " Check whether a URL points to an existing resource (using Python). |
277 | 293 | try |
|
0 commit comments