patch 8.0.0044
Problem: In diff mode the cursor may end up below the last line, resulting
in an ml_get error.
Solution: Check the line to be valid.
diff --git a/src/move.c b/src/move.c
index a4d5f82..c7acdfa 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2824,11 +2824,8 @@
{
# ifdef FEAT_DIFF
if (curwin->w_p_diff)
- curwin->w_cursor.lnum
- = diff_get_corresponding_line(old_curbuf,
- line,
- curbuf,
- curwin->w_cursor.lnum);
+ curwin->w_cursor.lnum =
+ diff_get_corresponding_line(old_curbuf, line);
else
# endif
curwin->w_cursor.lnum = line;