Skip to content

Commit 6e8d074

Browse files
committed
updated for version 7.4.368
Problem: Restoring the window sizes after closing the command line window doesn't work properly if there are nested splits. Solution: Restore the sizes twice. (Hirohito Higashi)
1 parent f974567 commit 6e8d074

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
368,
737739
/**/
738740
367,
739741
/**/

src/window.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4848,15 +4848,20 @@ win_size_restore(gap)
48484848
garray_T *gap;
48494849
{
48504850
win_T *wp;
4851-
int i;
4851+
int i, j;
48524852

48534853
if (win_count() * 2 == gap->ga_len)
48544854
{
4855-
i = 0;
4856-
for (wp = firstwin; wp != NULL; wp = wp->w_next)
4855+
/* The order matters, because frames contain other frames, but it's
4856+
* difficult to get right. The easy way out is to do it twice. */
4857+
for (j = 0; j < 2; ++j)
48574858
{
4858-
frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
4859-
win_setheight_win(((int *)gap->ga_data)[i++], wp);
4859+
i = 0;
4860+
for (wp = firstwin; wp != NULL; wp = wp->w_next)
4861+
{
4862+
frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
4863+
win_setheight_win(((int *)gap->ga_data)[i++], wp);
4864+
}
48604865
}
48614866
/* recompute the window positions */
48624867
(void)win_comp_pos();

0 commit comments

Comments
 (0)