File tree 5 files changed +50
-14
lines changed
5 files changed +50
-14
lines changed Original file line number Diff line number Diff line change @@ -8796,6 +8796,7 @@ set_num_option(
8796
8796
*/
8797
8797
if (pp == & p_wh || pp == & p_hh )
8798
8798
{
8799
+ // 'winheight' and 'helpheight'
8799
8800
if (p_wh < 1 )
8800
8801
{
8801
8802
errmsg = e_positive ;
@@ -8821,10 +8822,9 @@ set_num_option(
8821
8822
win_setheight ((int )p_hh );
8822
8823
}
8823
8824
}
8824
-
8825
- /* 'winminheight' */
8826
8825
else if (pp == & p_wmh )
8827
8826
{
8827
+ // 'winminheight'
8828
8828
if (p_wmh < 0 )
8829
8829
{
8830
8830
errmsg = e_positive ;
@@ -8839,6 +8839,7 @@ set_num_option(
8839
8839
}
8840
8840
else if (pp == & p_wiw )
8841
8841
{
8842
+ // 'winwidth'
8842
8843
if (p_wiw < 1 )
8843
8844
{
8844
8845
errmsg = e_positive ;
@@ -8854,10 +8855,9 @@ set_num_option(
8854
8855
if (!ONE_WINDOW && curwin -> w_width < p_wiw )
8855
8856
win_setwidth ((int )p_wiw );
8856
8857
}
8857
-
8858
- /* 'winminwidth' */
8859
8858
else if (pp == & p_wmw )
8860
8859
{
8860
+ // 'winminwidth'
8861
8861
if (p_wmw < 0 )
8862
8862
{
8863
8863
errmsg = e_positive ;
@@ -8868,7 +8868,7 @@ set_num_option(
8868
8868
errmsg = e_winwidth ;
8869
8869
p_wmw = p_wiw ;
8870
8870
}
8871
- win_setminheight ();
8871
+ win_setminwidth ();
8872
8872
}
8873
8873
8874
8874
/* (re)set last window status line */
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ void win_setheight_win(int height, win_T *win);
54
54
void win_setwidth (int width );
55
55
void win_setwidth_win (int width , win_T * wp );
56
56
void win_setminheight (void );
57
+ void win_setminwidth (void );
57
58
void win_drag_status_line (win_T * dragwin , int offset );
58
59
void win_drag_vsep_line (win_T * dragwin , int offset );
59
60
void set_fraction (win_T * wp );
Original file line number Diff line number Diff line change @@ -106,13 +106,22 @@ endfunc
106
106
107
107
func Test_mksession_winheight ()
108
108
new
109
- set winheight = 10 winminheight = 2
109
+ set winheight = 10
110
+ set winminheight = 2
110
111
mksession ! Xtest_mks.out
111
112
source Xtest_mks.out
112
113
113
114
call delete (' Xtest_mks.out' )
114
115
endfunc
115
116
117
+ func Test_mksession_large_winheight ()
118
+ set winheight = 999
119
+ mksession ! Xtest_mks_winheight.out
120
+ set winheight &
121
+ source Xtest_mks_winheight.out
122
+ call delete (' Xtest_mks_winheight.out' )
123
+ endfunc
124
+
116
125
func Test_mksession_arglist ()
117
126
argdel *
118
127
next file1 file2 file3 file4
Original file line number Diff line number Diff line change @@ -761,6 +761,8 @@ static char *(features[]) =
761
761
762
762
static int included_patches [] =
763
763
{ /* Add new patch number below this line */
764
+ /**/
765
+ 46 ,
764
766
/**/
765
767
45 ,
766
768
/**/
Original file line number Diff line number Diff line change @@ -5430,23 +5430,21 @@ frame_setwidth(frame_T *curfrp, int width)
5430
5430
}
5431
5431
5432
5432
/*
5433
- * Check 'winminheight' for a valid value.
5433
+ * Check 'winminheight' for a valid value and reduce it if needed .
5434
5434
*/
5435
5435
void
5436
5436
win_setminheight (void )
5437
5437
{
5438
5438
int room ;
5439
+ int needed ;
5439
5440
int first = TRUE;
5440
- win_T * wp ;
5441
5441
5442
- /* loop until there is a 'winminheight' that is possible */
5442
+ // loop until there is a 'winminheight' that is possible
5443
5443
while (p_wmh > 0 )
5444
5444
{
5445
- /* TODO: handle vertical splits */
5446
- room = - p_wh ;
5447
- FOR_ALL_WINDOWS (wp )
5448
- room += VISIBLE_HEIGHT (wp ) - p_wmh ;
5449
- if (room >= 0 )
5445
+ room = Rows - p_ch ;
5446
+ needed = frame_minheight (topframe , NULL );
5447
+ if (room >= needed )
5450
5448
break ;
5451
5449
-- p_wmh ;
5452
5450
if (first )
@@ -5457,6 +5455,32 @@ win_setminheight(void)
5457
5455
}
5458
5456
}
5459
5457
5458
+ /*
5459
+ * Check 'winminwidth' for a valid value and reduce it if needed.
5460
+ */
5461
+ void
5462
+ win_setminwidth (void )
5463
+ {
5464
+ int room ;
5465
+ int needed ;
5466
+ int first = TRUE;
5467
+
5468
+ // loop until there is a 'winminheight' that is possible
5469
+ while (p_wmw > 0 )
5470
+ {
5471
+ room = Columns ;
5472
+ needed = frame_minwidth (topframe , NULL );
5473
+ if (room >= needed )
5474
+ break ;
5475
+ -- p_wmw ;
5476
+ if (first )
5477
+ {
5478
+ EMSG (_ (e_noroom ));
5479
+ first = FALSE;
5480
+ }
5481
+ }
5482
+ }
5483
+
5460
5484
#if defined(FEAT_MOUSE ) || defined(PROTO )
5461
5485
5462
5486
/*
You can’t perform that action at this time.
0 commit comments