Skip to content

Commit 9232554

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.0310: Filler lines not checked properly in get_scroll_overlap()
Problem: Filler lines not checked properly in get_scroll_overlap(). Solution: Add missing parentheses (zeertzjq). The missing parentheses causes the second argument to diff_check_fill() to always be 0 as it is the result of a comparison between a positive integer and -1 (the value of BACKWARD), in which case diff_check_fill() always returns 0 instead of the number of filler lines above a line. It's very hard to add a test for this, because this mistake at most leads to 2 screen lines of difference in scrolling behavior, and in cases where it may indeed lead to a difference in behavior, neither behavior achieves complete symmetry between CTRL-F and CTRL-B. closes: #14527 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 0549c50 commit 9232554

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/move.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3102,7 +3102,7 @@ static int get_scroll_overlap(int dir)
31023102

31033103
loff.lnum = dir == FORWARD ? curwin->w_botline : curwin->w_topline - 1;
31043104
#ifdef FEAT_DIFF
3105-
loff.fill = diff_check_fill(curwin, loff.lnum + dir == BACKWARD)
3105+
loff.fill = diff_check_fill(curwin, loff.lnum + (dir == BACKWARD))
31063106
- (dir == FORWARD ? curwin->w_filler_rows : curwin->w_topfill);
31073107
loff.height = loff.fill > 0 ? 1 : plines_nofill(loff.lnum);
31083108
#else

src/version.c

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

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
310,
707709
/**/
708710
309,
709711
/**/

0 commit comments

Comments
 (0)