* resized when moving between windows.
* Do this before restoring the view, so that the topline and the
* cursor can be set. This is done again below.
+ * winminheight and winminwidth need to be set to avoid an error if the
+ * user has set winheight or winwidth.
*/
- if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
+ if (put_line(fd, "set winminheight=1 winheight=1 winminwidth=1 winwidth=1") == FAIL)
return FAIL;
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
return FAIL;
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
return FAIL;
+ /* Re-apply 'winminheight' and 'winminwidth'. */
+ if (fprintf(fd, "set winminheight=%ld winminwidth=%ld",
+ p_wmh, p_wmw) < 0 || put_eol(fd) == FAIL)
+ return FAIL;
/*
* Lastly, execute the x.vim file if it exists.
let &wrap = wrap_save
endfunc
+func Test_mksession_winheight()
+ new
+ set winheight=10 winminheight=2
+ mksession! test_mks.out
+ source test_mks.out
+
+ " call delete('test_mks.out')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab