patch 8.2.1211: removed more than dead code
Problem: Removed more than dead code.
Solution: Put back the decrement.
diff --git a/src/move.c b/src/move.c
index ec1ad38..767134f 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2681,6 +2681,7 @@
if (curwin->w_topfill > 0)
{
i = 1;
+ --n;
--curwin->w_topfill;
}
else
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index a3f6d58..c0c5d0d 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -1130,4 +1130,24 @@
redraw
endfunc
+func Test_diff_and_scroll()
+ " this was causing an ml_get error
+ set ls=2
+ for i in range(winheight(0) * 2)
+ call setline(i, i < winheight(0) - 10 ? i : i + 10)
+ endfor
+ vnew
+ for i in range(winheight(0)*2 + 10)
+ call setline(i, i < winheight(0) - 10 ? 0 : i)
+ endfor
+ diffthis
+ wincmd p
+ diffthis
+ execute 'normal ' . winheight(0) . "\<C-d>"
+
+ bwipe!
+ bwipe!
+ set ls&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 6be113d..95b0857 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1211,
+/**/
1210,
/**/
1209,