0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2017-11-02 19:08:48 +01:00
parent c20e0d5207
commit f8f8b2eadb
4 changed files with 125 additions and 3 deletions

View File

@@ -1717,12 +1717,19 @@ getcmdline(
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 @@ cmdline_changed:
{
i = 0;
SET_NO_HLSEARCH(TRUE); /* turn off previous highlight */
redraw_all_later(SOME_VALID);
}
else
{
@@ -2082,7 +2090,7 @@ returncmd:
curwin->w_botline = old_botline;
highlight_match = FALSE;
validate_cursor(); /* needed for TAB */
redraw_later(SOME_VALID);
redraw_all_later(SOME_VALID);
}
#endif