Skip to content

Commit 5338653

Browse files
committed
Merge pull request #94: Handle (i.e. do not increase) zero-width windows
2 parents 70cbfa9 + c8f8417 commit 5338653

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Recently this plug-in switched from reimplementing [:mksession][mksession] to ac
246246
<!-- Start of generated documentation -->
247247

248248
The documentation of the 34 functions below was extracted from
249-
1 Vim scripts on June 18, 2014 at 22:45.
249+
1 Vim scripts on June 18, 2014 at 22:49.
250250

251251
### Public API for the vim-session plug-in
252252

autoload/xolox/session.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Public API for the vim-session plug-in.
22
"
33
" Author: Peter Odding
4-
" Last Change: June 17, 2014
4+
" Last Change: June 18, 2014
55
" URL: http://peterodding.com/code/vim/session/
66

77
let g:xolox#session#version = '2.4.11'
@@ -55,8 +55,10 @@ function! xolox#session#save_session(commands, filename) " {{{2
5555
if is_all_tabs
5656
call add(a:commands, 'doautoall SessionLoadPost')
5757
else
58+
call add(a:commands, 'let s:winrestcmd = winrestcmd()')
5859
call add(a:commands, 'windo doautocmd SessionLoadPost')
5960
call s:jump_to_window(a:commands, tabpagenr(), winnr())
61+
call add(a:commands, 'silent! execute s:winrestcmd')
6062
endif
6163
call add(a:commands, 'unlet SessionLoad')
6264
call add(a:commands, '" vim: ft=vim ro nowrap smc=128')
@@ -294,9 +296,13 @@ endfunction
294296

295297
function! s:check_special_tabpage(session)
296298
let status = 0
299+
let winrestcmd = winrestcmd()
300+
let window = winnr()
297301
windo let status += s:check_special_window(a:session)
302+
execute window . 'wincmd w'
303+
silent! execute winrestcmd
298304
if status > 0 && winnr('$') > 1
299-
call add(a:session, winrestcmd())
305+
call add(a:session, winrestcmd)
300306
endif
301307
endfunction
302308

doc/session.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ might take a while...)
490490
Function reference ~
491491

492492
The documentation of the 34 functions below was extracted from 1 Vim scripts on
493-
June 18, 2014 at 22:45.
493+
June 18, 2014 at 22:49.
494494

495495
-------------------------------------------------------------------------------
496496
*public-api-for-vim-session-plug-in*

0 commit comments

Comments
 (0)