From aeca7176f3b7bdc2d698938062f6cad802fea783 Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Wed, 19 Jun 2024 19:42:47 +0200 Subject: [PATCH] runtime(nohlsearch): simplify mapping Use instead of with execute(...)[-1] closes: #15047 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- runtime/doc/usr_05.txt | 4 ++-- runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 5065e4583c..d9222594ce 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2024 Jun 18 +*usr_05.txt* For Vim version 9.1. Last change: 2024 Jun 19 VIM USER MANUAL - by Bram Moolenaar @@ -459,7 +459,7 @@ Automatically execute |:nohlsearch| after 'updatetime' or getting into |Insert| Thus assuming default updatetime, hlsearch would be suspended/turned off after 4 seconds of idle time. -To disable the effect of the plugin after is has been loaded: > +To disable the effect of the plugin after it has been loaded: > au! nohlsearch < diff --git a/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim b/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim index 6cfe813cfa..8d9930742c 100644 --- 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-06-18 +" Last Change: 2024-06-19 " Maintainer: Maxim Kim " " turn off hlsearch after: @@ -8,7 +8,7 @@ augroup nohlsearch au! noremap (nohlsearch) nohlsearch - noremap! (nohlsearch) execute('nohlsearch')[-1] + noremap! (nohlsearch) nohlsearch au CursorHold * call feedkeys("\(nohlsearch)", 'm') au InsertEnter * call feedkeys("\(nohlsearch)", 'm') augroup END