patch 9.0.1530: cursor moves to wrong line when 'foldmethod' is "diff"

Problem:    Cursor moves to wrong line when 'foldmethod' is "diff". (Rick
            Howe)
Solution:   Adjust logic for scrolling. (Luuk van Baal, closes #12364,
            closes #12218)
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 470b41c..a3d9454 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -3980,4 +3980,22 @@
   call delete('Xmouseshapes')
 endfunc
 
+" Test that "j" does not skip lines when scrolling below botline and
+" 'foldmethod' is not "manual".
+func Test_normal_j_below_botline()
+  CheckScreendump
+
+  let lines =<< trim END
+    set number foldmethod=diff scrolloff=0
+    call setline(1, map(range(1, 9), 'repeat(v:val, 200)'))
+    norm Lj
+  END
+  call writefile(lines, 'XNormalJBelowBotline', 'D')
+  let buf = RunVimInTerminal('-S XNormalJBelowBotline', #{rows: 19, cols: 40})
+
+  call VerifyScreenDump(buf, 'Test_normal_j_below_botline', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab