diff options
author | Aufar Gilbran <aufargilbran@gmail.com> | 2020-08-19 00:51:08 +0800 |
---|---|---|
committer | Aufar Gilbran <aufargilbran@gmail.com> | 2020-09-11 10:37:52 +0800 |
commit | f2743cfb6555ad0c917a59539a97f74737479ef1 (patch) | |
tree | 18b08a50af853d9c90e9f53797228ddd3b323ce3 /src/nvim/ex_getln.c | |
parent | 4770a2bac52530dcfec64aa61cf29379a5ddec36 (diff) | |
download | rneovim-f2743cfb6555ad0c917a59539a97f74737479ef1.tar.gz rneovim-f2743cfb6555ad0c917a59539a97f74737479ef1.tar.bz2 rneovim-f2743cfb6555ad0c917a59539a97f74737479ef1.zip |
vim-patch:8.1.0321: 'incsearch' regression: /\v highlights everything
Problem: 'incsearch' regression: /\v highlights everything.
Solution: Put back the empty_pattern() check.
https://github.com/vim/vim/commit/4edfe2d2a2d70ea66a7f73e9b923c2d1f6246a57
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 241e8a9a89..49e017fda1 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -519,6 +519,17 @@ static void may_do_incsearch_highlighting(int firstc, long count, } 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. |