patch 8.0.1250: 'hlsearch' highlighting not removed after incsearch
Problem: 'hlsearch' highlighting not removed after incsearch (lacygoill)
Solution: Redraw all windows. Start search at the end of the match. Improve
how CTRL-G works with incremental search. Add tests. (Christian
Brabandt, Hirohito Higashi, haya14busa, closes #2267)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 717a012..0270477 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1717,12 +1717,19 @@
pos_T t;
int search_flags = SEARCH_NOOF;
+ if (ccline.cmdlen == 0)
+ goto cmdline_not_changed;
+
save_last_search_pattern();
cursor_off();
out_flush();
if (c == Ctrl_G)
{
t = match_end;
+ if (LT_POS(match_start, match_end))
+ /* start searching at the end of the match
+ * not at the beginning of the next column */
+ (void)decl(&t);
search_flags += SEARCH_COL;
}
else
@@ -1945,6 +1952,7 @@
{
i = 0;
SET_NO_HLSEARCH(TRUE); /* turn off previous highlight */
+ redraw_all_later(SOME_VALID);
}
else
{
@@ -2082,7 +2090,7 @@
curwin->w_botline = old_botline;
highlight_match = FALSE;
validate_cursor(); /* needed for TAB */
- redraw_later(SOME_VALID);
+ redraw_all_later(SOME_VALID);
}
#endif