From e14aa3c035f93686ee73e64fec1fb4f648b0f800 Mon Sep 17 00:00:00 2001 From: Hirohito Higashi Date: Sat, 22 Mar 2025 15:58:59 +0100 Subject: [PATCH] runtime(hlyank): update the hlyank package closes: #16944 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- runtime/doc/usr_05.txt | 10 ++++++---- runtime/pack/dist/opt/hlyank/plugin/hlyank.vim | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 4b7bc9ffc0..56714dbd8d 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: 2025 Mar 18 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 22 VIM USER MANUAL - by Bram Moolenaar @@ -470,8 +470,8 @@ Load the plugin with this command: > packadd hlyank < This package briefly highlights the affected region of the last |yank| -command. See |52.6| for a simplified implementation using the |getregionpos()| -function. +command. See |52.6| for a simplified implementation using the +|getregionpos()| function. The plugin understands the following configuration variables (the settings show the default values). @@ -481,7 +481,9 @@ To specify a different highlighting group, use: > < To use a different highlighting duration, use: > :let g:hlyank_duration = 300 -< +The unit is milliseconds, and the upper limit is 3000 ms. If you set a value +higher than this, the highlighting duration will be 3000 ms. + To highlight in visual mode, use: > :let g:hlyank_invisual = v:true diff --git a/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim b/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim index 079e38a1b6..4b568fae24 100644 --- a/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim +++ b/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim @@ -1,12 +1,12 @@ vim9script # Highlight Yank plugin -# Last Change: 2025 Mar 17 +# Last Change: 2025 Mar 22 def HighlightedYank() var hlgroup = get(g:, "hlyank_hlgroup", "IncSearch") - var duration = get(g:, "hlyank_duration", 300) + var duration = min([get(g:, "hlyank_duration", 300), 3000]) var in_visual = get(g:, "hlyank_invisual", true) if v:event.operator ==? 'y' @@ -14,8 +14,8 @@ def HighlightedYank() visualmode(1) return endif - # if clipboard has autoselect (default on linux) exiting from Visual with ESC - # generates bogus event and this highlights previous yank + # if clipboard has autoselect (default on linux) exiting from Visual with + # ESC generates bogus event and this highlights previous yank if &clipboard =~ 'autoselect' && v:event.regname == "*" && v:event.visual return endif @@ -36,3 +36,4 @@ augroup hlyank autocmd! autocmd TextYankPost * HighlightedYank() augroup END +# vim:sts=2:sw=2:et: