patch 8.1.0499: :2vimgrep causes an ml_get error
Problem: :2vimgrep causes an ml_get error
Solution: Pass tomatch pointer instead of value. (Yegappan Lakshmanan)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index e37ebe2..31e646d 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -483,6 +483,12 @@
if (search_first_line == 0)
// start at the original cursor position
curwin->w_cursor = is_state->search_start;
+ else if (search_first_line > curbuf->b_ml.ml_line_count)
+ {
+ // start after the last line
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.col = MAXCOL;
+ }
else
{
// start at the first line in the range