neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 671841673e7b66f4f40a49a000a6a46e662f802e
parent a04c73ca071fdc2461365a8a10a314bd0d1d806d
Author: An Guoli <qaq@qaq.land>
Date:   Sat, 18 Oct 2025 09:28:58 +0800

vim-patch:ce4f9d2: runtime(nohlsearch): fix CursorHold loop (#36221)

fix exception when entering the insert mode with paste

closes: vim/vim#16818

https://github.com/vim/vim/commit/ce4f9d2a1016ade19fa07c5b66e58eb084719192
Diffstat:
Mruntime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim b/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim @@ -1,5 +1,5 @@ " nohlsearch.vim: Auto turn off hlsearch -" Last Change: 2024-07-31 +" Last Change: 2025-03-08 " Maintainer: Maxim Kim <habamax@gmail.com> " " turn off hlsearch after: @@ -11,10 +11,14 @@ if exists('g:loaded_nohlsearch') endif let g:loaded_nohlsearch = 1 +func! s:Nohlsearch() + if v:hlsearch + call feedkeys("\<cmd>nohlsearch\<cr>", 'm') + endif +endfunc + augroup nohlsearch au! - noremap <Plug>(nohlsearch) <cmd>nohlsearch<cr> - noremap! <Plug>(nohlsearch) <cmd>nohlsearch<cr> - au CursorHold * call feedkeys("\<Plug>(nohlsearch)", 'm') - au InsertEnter * call feedkeys("\<Plug>(nohlsearch)", 'm') + au CursorHold * call s:Nohlsearch() + au InsertEnter * call s:Nohlsearch() augroup END