diff src/ex_getln.c @ 12744:0c704288ced4 v8.0.1250

patch 8.0.1250: 'hlsearch' highlighting not removed after incsearch commit https://github.com/vim/vim/commit/f8f8b2eadbaf3090fcfccbab560de5dbd501833d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 2 19:08:48 2017 +0100 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)
author Christian Brabandt <cb@256bit.org>
date Thu, 02 Nov 2017 19:15:05 +0100
parents 37c384802df4
children 3c09e451af3a
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -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