]> granicus.if.org Git - vim/commitdiff
patch 7.4.853 v7.4.853
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Sep 2015 18:53:24 +0000 (20:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Sep 2015 18:53:24 +0000 (20:53 +0200)
Problem:    "zt" in diff mode does not always work properly. (Gary Johnson)
Solution:   Don't count filler lines twice. (Christian Brabandt)

src/move.c
src/version.c

index 0242fefa6fe82c17602b8755fe943cdc18697ecb..594f9acf57cf7931860f24411b3a88c31cd7278a 100644 (file)
@@ -1732,7 +1732,7 @@ scroll_cursor_top(min_scroll, always)
      * - at least 'scrolloff' lines above and below the cursor
      */
     validate_cheight();
-    used = curwin->w_cline_height;
+    used = curwin->w_cline_height; /* includes filler lines above */
     if (curwin->w_cursor.lnum < curwin->w_topline)
        scrolled = used;
 
@@ -1751,10 +1751,12 @@ scroll_cursor_top(min_scroll, always)
     new_topline = top + 1;
 
 #ifdef FEAT_DIFF
-    /* count filler lines of the cursor window as context */
-    i = diff_check_fill(curwin, curwin->w_cursor.lnum);
-    used += i;
-    extra += i;
+    /* used already contains the number of filler lines above, don't add it
+     * again.
+     * TODO: if filler lines above new top are to be considered as context for
+     * the current window, leave next statement commented, else hide filler
+     * lines above cursor line, by adding them to extra */
+    /* extra += diff_check_fill(curwin, curwin->w_cursor.lnum); */
 #endif
 
     /*
index 2aa3807475b5b0c10ab4aa3eafbd7d84edbd220c..7b0ad1b98adc899939d701ed1be4de16988e4f34 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    853,
 /**/
     852,
 /**/