Skip to content

Commit cf619da

Browse files
committed
patch 7.4.853
Problem: "zt" in diff mode does not always work properly. (Gary Johnson) Solution: Don't count filler lines twice. (Christian Brabandt)
1 parent ac360bf commit cf619da

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/move.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ scroll_cursor_top(min_scroll, always)
17321732
* - at least 'scrolloff' lines above and below the cursor
17331733
*/
17341734
validate_cheight();
1735-
used = curwin->w_cline_height;
1735+
used = curwin->w_cline_height; /* includes filler lines above */
17361736
if (curwin->w_cursor.lnum < curwin->w_topline)
17371737
scrolled = used;
17381738

@@ -1751,10 +1751,12 @@ scroll_cursor_top(min_scroll, always)
17511751
new_topline = top + 1;
17521752

17531753
#ifdef FEAT_DIFF
1754-
/* count filler lines of the cursor window as context */
1755-
i = diff_check_fill(curwin, curwin->w_cursor.lnum);
1756-
used += i;
1757-
extra += i;
1754+
/* used already contains the number of filler lines above, don't add it
1755+
* again.
1756+
* TODO: if filler lines above new top are to be considered as context for
1757+
* the current window, leave next statement commented, else hide filler
1758+
* lines above cursor line, by adding them to extra */
1759+
/* extra += diff_check_fill(curwin, curwin->w_cursor.lnum); */
17581760
#endif
17591761

17601762
/*

src/version.c

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

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
853,
744746
/**/
745747
852,
746748
/**/

0 commit comments

Comments
 (0)