patch 8.1.0284: 'cursorline' highlighting wrong with 'incsearch'
Problem: 'cursorline' highlighting wrong with 'incsearch'.
Solution: Move the cursor back if the match is outside the range.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index a8c5cfb..ba6fe72 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -480,8 +480,11 @@
if (curwin->w_cursor.lnum < search_first_line
|| curwin->w_cursor.lnum > search_last_line)
+ {
// match outside of address range
i = 0;
+ curwin->w_cursor = is_state->search_start;
+ }
// if interrupted while searching, behave like it failed
if (got_int)