]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(nohlsearch): simplify mapping
authorMaxim Kim <habamax@gmail.com>
Wed, 19 Jun 2024 17:42:47 +0000 (19:42 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 19 Jun 2024 17:42:47 +0000 (19:42 +0200)
Use <cmd> instead of <expr> with execute(...)[-1]

closes: #15047

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/usr_05.txt
runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim

index 5065e4583c8fa8677d2c6c5648e59854fdf1d6a6..d9222594ce2174ae5e52bc04620545b0004ba18f 100644 (file)
@@ -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
 <
 
index 6cfe813cfa273e8cf3859c040ebf721760ff1405..8d9930742c9eb80c75e1724dccad858dee90826b 100644 (file)
@@ -1,5 +1,5 @@
 " nohlsearch.vim: Auto turn off hlsearch
-" Last Change: 2024-06-18
+" Last Change: 2024-06-19
 " Maintainer: Maxim Kim <habamax@gmail.com>
 "
 " turn off hlsearch after:
@@ -8,7 +8,7 @@
 augroup nohlsearch
     au!
     noremap <Plug>(nohlsearch) <cmd>nohlsearch<cr>
-    noremap! <expr> <Plug>(nohlsearch) execute('nohlsearch')[-1]
+    noremap! <Plug>(nohlsearch) <cmd>nohlsearch<cr>
     au CursorHold * call feedkeys("\<Plug>(nohlsearch)", 'm')
     au InsertEnter * call feedkeys("\<Plug>(nohlsearch)", 'm')
 augroup END