diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-28 17:11:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-28 17:11:14 +0100 |
commit | 36ae89c550a4f0a380606c3fb4a054957ad698f0 (patch) | |
tree | 58e9a87402e478ec4e11af06861c1363df52fdac /src/ex_docmd.c | |
parent | 4019cf90b8657d4ab1c39744db63550f44f405a2 (diff) | |
download | vim-git-36ae89c550a4f0a380606c3fb4a054957ad698f0.tar.gz |
patch 8.0.0253: error when loading session if winminheight is 2v8.0.0253
Problem: When creating a session when winminheight is 2 or larger and
loading that session gives an error.
Solution: Also set winminheight before setting winheight to 1. (Rafael
Bodill, neovim #5717)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index bfb4c88d4..192f45d19 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -11197,8 +11197,10 @@ makeopens( * 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; @@ -11268,6 +11270,10 @@ makeopens( 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. |