comparison src/ex_docmd.c @ 10726:78927b31c73a v8.0.0253

patch 8.0.0253: error when loading session if winminheight is 2 commit https://github.com/vim/vim/commit/36ae89c550a4f0a380606c3fb4a054957ad698f0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 28 17:11:14 2017 +0100 patch 8.0.0253: error when loading session if winminheight is 2 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)
author Christian Brabandt <cb@256bit.org>
date Sat, 28 Jan 2017 17:15:04 +0100
parents 7598ce51bf2a
children 380e706814da
comparison
equal deleted inserted replaced
10725:d2aa3ad3d3ef 10726:78927b31c73a
11195 * If more than one window, see if sizes can be restored. 11195 * If more than one window, see if sizes can be restored.
11196 * First set 'winheight' and 'winwidth' to 1 to avoid the windows being 11196 * First set 'winheight' and 'winwidth' to 1 to avoid the windows being
11197 * resized when moving between windows. 11197 * resized when moving between windows.
11198 * Do this before restoring the view, so that the topline and the 11198 * Do this before restoring the view, so that the topline and the
11199 * cursor can be set. This is done again below. 11199 * cursor can be set. This is done again below.
11200 * winminheight and winminwidth need to be set to avoid an error if the
11201 * user has set winheight or winwidth.
11200 */ 11202 */
11201 if (put_line(fd, "set winheight=1 winwidth=1") == FAIL) 11203 if (put_line(fd, "set winminheight=1 winheight=1 winminwidth=1 winwidth=1") == FAIL)
11202 return FAIL; 11204 return FAIL;
11203 if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL) 11205 if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
11204 return FAIL; 11206 return FAIL;
11205 11207
11206 /* 11208 /*
11265 return FAIL; 11267 return FAIL;
11266 11268
11267 /* Re-apply 'winheight', 'winwidth' and 'shortmess'. */ 11269 /* Re-apply 'winheight', 'winwidth' and 'shortmess'. */
11268 if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s", 11270 if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
11269 p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL) 11271 p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
11272 return FAIL;
11273 /* Re-apply 'winminheight' and 'winminwidth'. */
11274 if (fprintf(fd, "set winminheight=%ld winminwidth=%ld",
11275 p_wmh, p_wmw) < 0 || put_eol(fd) == FAIL)
11270 return FAIL; 11276 return FAIL;
11271 11277
11272 /* 11278 /*
11273 * Lastly, execute the x.vim file if it exists. 11279 * Lastly, execute the x.vim file if it exists.
11274 */ 11280 */