forked from aniani/vim
patch 8.1.0046: loading a session file fails if 'winheight' is big
Problem: Loading a session file fails if 'winheight' is a big number.
Solution: Set 'minwinheight' to zero at first. Don't give an error when
setting 'minwinheight' while 'winheight' is a big number.
Fix using vertical splits. Fix setting 'minwinwidth'.
(closes #2970)
This commit is contained in:
10
src/option.c
10
src/option.c
@@ -8796,6 +8796,7 @@ set_num_option(
|
||||
*/
|
||||
if (pp == &p_wh || pp == &p_hh)
|
||||
{
|
||||
// 'winheight' and 'helpheight'
|
||||
if (p_wh < 1)
|
||||
{
|
||||
errmsg = e_positive;
|
||||
@@ -8821,10 +8822,9 @@ set_num_option(
|
||||
win_setheight((int)p_hh);
|
||||
}
|
||||
}
|
||||
|
||||
/* 'winminheight' */
|
||||
else if (pp == &p_wmh)
|
||||
{
|
||||
// 'winminheight'
|
||||
if (p_wmh < 0)
|
||||
{
|
||||
errmsg = e_positive;
|
||||
@@ -8839,6 +8839,7 @@ set_num_option(
|
||||
}
|
||||
else if (pp == &p_wiw)
|
||||
{
|
||||
// 'winwidth'
|
||||
if (p_wiw < 1)
|
||||
{
|
||||
errmsg = e_positive;
|
||||
@@ -8854,10 +8855,9 @@ set_num_option(
|
||||
if (!ONE_WINDOW && curwin->w_width < p_wiw)
|
||||
win_setwidth((int)p_wiw);
|
||||
}
|
||||
|
||||
/* 'winminwidth' */
|
||||
else if (pp == &p_wmw)
|
||||
{
|
||||
// 'winminwidth'
|
||||
if (p_wmw < 0)
|
||||
{
|
||||
errmsg = e_positive;
|
||||
@@ -8868,7 +8868,7 @@ set_num_option(
|
||||
errmsg = e_winwidth;
|
||||
p_wmw = p_wiw;
|
||||
}
|
||||
win_setminheight();
|
||||
win_setminwidth();
|
||||
}
|
||||
|
||||
/* (re)set last window status line */
|
||||
|
||||
Reference in New Issue
Block a user