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

patch 8.1.0321: 'incsearch' regression: /\v highlights everything

Problem:    'incsearch' regression: /\v highlights everything.
Solution:   Put back the empty_pattern() check.
This commit is contained in:
Bram Moolenaar
2018-08-23 20:55:45 +02:00
parent 8b0d5ce881
commit 4edfe2d2a2
5 changed files with 67 additions and 1 deletions

View File

@@ -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)