summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-23 20:55:45 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-23 20:55:45 +0200
commit4edfe2d2a2d70ea66a7f73e9b923c2d1f6246a57 (patch)
tree5e1d553a935a4a4d35babfc7dc04ff27cb4b9d2c /src/ex_getln.c
parent8b0d5ce881ac16a36ea00018ba13a58b0fdb7534 (diff)
patch 8.1.0321: 'incsearch' regression: /\v highlights everythingv8.1.0321
Problem: 'incsearch' regression: /\v highlights everything. Solution: Put back the empty_pattern() check.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 1cb3c8b7a1..7f748cb17d 100644
--- 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)