changeset 3904:64427849c158 v7.3.708

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)
author Bram Moolenaar <bram@vim.org>
date Sun, 21 Oct 2012 22:18:21 +0200
parents b7966720d38c
children 40e1ee173ecc
files src/diff.c src/testdir/test47.in src/testdir/test47.ok src/version.c
diffstat 4 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/diff.c
+++ b/src/diff.c
@@ -615,11 +615,13 @@ diff_redraw(dofold)
 #endif
 	    /* A change may have made filler lines invalid, need to take care
 	     * of that for other windows. */
-	    if (wp != curwin && wp->w_topfill > 0)
+	    n = diff_check(wp, wp->w_topline);
+	    if ((wp != curwin && wp->w_topfill > 0) || n > 0)
 	    {
-		n = diff_check(wp, wp->w_topline);
 		if (wp->w_topfill > n)
 		    wp->w_topfill = (n < 0 ? 0 : n);
+		else if (n > 0 && n > wp->w_topfill)
+		    wp->w_topfill = n;
 	    }
 	}
 }
--- a/src/testdir/test47.in
+++ b/src/testdir/test47.in
@@ -36,7 +36,22 @@ j:let three = three . "-" . winline()
 :call append("$", two)
 :call append("$", three)
 :$-2,$w! test.out
-:unlet one two three
+:" Test that diffing shows correct filler lines
+:diffoff!
+:windo :bw!
+:enew
+:put =range(4,10)
+:1d _
+:vnew
+:put =range(1,10)
+:1d _
+:windo :diffthis
+:wincmd h
+:let w0=line('w0')
+:enew
+:put =w0
+:.w >> test.out
+:unlet! one two three w0
 :qa!
 ENDTEST
 
--- a/src/testdir/test47.ok
+++ b/src/testdir/test47.ok
@@ -1,3 +1,4 @@
 2-4-5-6-8-9
 1-2-4-5-8
 2-3-4-5-6-7-8
+1
--- a/src/version.c
+++ b/src/version.c
@@ -726,6 +726,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    708,
+/**/
     707,
 /**/
     706,