Skip to content

Commit f3c5856

Browse files
committed
updated for version 7.3.708
Problem: Filler lines above the first line may be hidden when opening Vim. Solution: Change how topfill is computed. (Christian Brabandt)
1 parent b0e6e48 commit f3c5856

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

src/diff.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,13 @@ diff_redraw(dofold)
615615
#endif
616616
/* A change may have made filler lines invalid, need to take care
617617
* of that for other windows. */
618-
if (wp != curwin && wp->w_topfill > 0)
618+
n = diff_check(wp, wp->w_topline);
619+
if ((wp != curwin && wp->w_topfill > 0) || n > 0)
619620
{
620-
n = diff_check(wp, wp->w_topline);
621621
if (wp->w_topfill > n)
622622
wp->w_topfill = (n < 0 ? 0 : n);
623+
else if (n > 0 && n > wp->w_topfill)
624+
wp->w_topfill = n;
623625
}
624626
}
625627
}

src/testdir/test47.in

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,22 @@ j:let three = three . "-" . winline()
3636
:call append("$", two)
3737
:call append("$", three)
3838
:$-2,$w! test.out
39-
:unlet one two three
39+
:" Test that diffing shows correct filler lines
40+
:diffoff!
41+
:windo :bw!
42+
:enew
43+
:put =range(4,10)
44+
:1d _
45+
:vnew
46+
:put =range(1,10)
47+
:1d _
48+
:windo :diffthis
49+
:wincmd h
50+
:let w0=line('w0')
51+
:enew
52+
:put =w0
53+
:.w >> test.out
54+
:unlet! one two three w0
4055
:qa!
4156
ENDTEST
4257

src/testdir/test47.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
2-4-5-6-8-9
22
1-2-4-5-8
33
2-3-4-5-6-7-8
4+
1

src/version.c

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

726726
static int included_patches[] =
727727
{ /* Add new patch number below this line */
728+
/**/
729+
708,
728730
/**/
729731
707,
730732
/**/

0 commit comments

Comments
 (0)