diff src/ex_getln.c @ 14615:c6b41d47bac1 v8.1.0321

patch 8.1.0321: 'incsearch' regression: / highlights everything commit https://github.com/vim/vim/commit/4edfe2d2a2d70ea66a7f73e9b923c2d1f6246a57 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 23 20:55:45 2018 +0200 patch 8.1.0321: 'incsearch' regression: /\v highlights everything Problem: 'incsearch' regression: /\v highlights everything. Solution: Put back the empty_pattern() check.
author Christian Brabandt <cb@256bit.org>
date Thu, 23 Aug 2018 21:00:06 +0200
parents 3f9b73cc8adb
children f3b183c3d3e2
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -572,6 +572,17 @@ may_do_incsearch_highlighting(
     else
 	end_pos = curwin->w_cursor; // shutup gcc 4
 
+    // Disable 'hlsearch' highlighting if the pattern matches everything.
+    // Avoids a flash when typing "foo\|".
+    if (!use_last_pat)
+    {
+	next_char = ccline.cmdbuff[skiplen + patlen];
+	ccline.cmdbuff[skiplen + patlen] = NUL;
+	if (empty_pattern(ccline.cmdbuff))
+	    set_no_hlsearch(TRUE);
+	ccline.cmdbuff[skiplen + patlen] = next_char;
+    }
+
     validate_cursor();
     // May redraw the status line to show the cursor position.
     if (p_ru && curwin->w_status_height > 0)