diff src/ex_getln.c @ 14774:5e5f2d824189 v8.1.0399

patch 8.1.0399: 'hlsearch' highlight remains in other window commit https://github.com/vim/vim/commit/65985ac998713dfe0f0ff1dd49c5e3e8f17f4870 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 16 17:08:04 2018 +0200 patch 8.1.0399: 'hlsearch' highlight remains in other window Problem: 'hlsearch' highlight remains in other window after cancelling command. Solution: Redraw all windows. Also remove unnecessary delays. (closes #3437)
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Sep 2018 17:15:05 +0200
parents fd69edd2c67e
children 7379bc1c3498
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -445,10 +445,9 @@ finish_incsearch_highlighting(
 	p_magic = is_state->magic_save;
 
 	validate_cursor();	/* needed for TAB */
+	redraw_all_later(SOME_VALID);
 	if (call_update_screen)
 	    update_screen(SOME_VALID);
-	else
-	    redraw_all_later(SOME_VALID);
     }
 }
 
@@ -589,8 +588,11 @@ may_do_incsearch_highlighting(
     {
 	next_char = ccline.cmdbuff[skiplen + patlen];
 	ccline.cmdbuff[skiplen + patlen] = NUL;
-	if (empty_pattern(ccline.cmdbuff))
+	if (empty_pattern(ccline.cmdbuff) && !no_hlsearch)
+	{
+	    redraw_all_later(SOME_VALID);
 	    set_no_hlsearch(TRUE);
+	}
 	ccline.cmdbuff[skiplen + patlen] = next_char;
     }