Skip to content

Commit e14aa3c

Browse files
h-eastchrisbra
authored andcommitted
runtime(hlyank): update the hlyank package
closes: #16944 Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 19d4f99 commit e14aa3c

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

runtime/doc/usr_05.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 18
1+
*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 22
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -470,8 +470,8 @@ Load the plugin with this command: >
470470
packadd hlyank
471471
<
472472
This package briefly highlights the affected region of the last |yank|
473-
command. See |52.6| for a simplified implementation using the |getregionpos()|
474-
function.
473+
command. See |52.6| for a simplified implementation using the
474+
|getregionpos()| function.
475475

476476
The plugin understands the following configuration variables (the settings
477477
show the default values).
@@ -481,7 +481,9 @@ To specify a different highlighting group, use: >
481481
<
482482
To use a different highlighting duration, use: >
483483
:let g:hlyank_duration = 300
484-
<
484+
The unit is milliseconds, and the upper limit is 3000 ms. If you set a value
485+
higher than this, the highlighting duration will be 3000 ms.
486+
485487
To highlight in visual mode, use: >
486488
:let g:hlyank_invisual = v:true
487489

runtime/pack/dist/opt/hlyank/plugin/hlyank.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
vim9script
22

33
# Highlight Yank plugin
4-
# Last Change: 2025 Mar 17
4+
# Last Change: 2025 Mar 22
55

66
def HighlightedYank()
77

88
var hlgroup = get(g:, "hlyank_hlgroup", "IncSearch")
9-
var duration = get(g:, "hlyank_duration", 300)
9+
var duration = min([get(g:, "hlyank_duration", 300), 3000])
1010
var in_visual = get(g:, "hlyank_invisual", true)
1111

1212
if v:event.operator ==? 'y'
1313
if !in_visual && visualmode() != null_string
1414
visualmode(1)
1515
return
1616
endif
17-
# if clipboard has autoselect (default on linux) exiting from Visual with ESC
18-
# generates bogus event and this highlights previous yank
17+
# if clipboard has autoselect (default on linux) exiting from Visual with
18+
# ESC generates bogus event and this highlights previous yank
1919
if &clipboard =~ 'autoselect' && v:event.regname == "*" && v:event.visual
2020
return
2121
endif
@@ -36,3 +36,4 @@ augroup hlyank
3636
autocmd!
3737
autocmd TextYankPost * HighlightedYank()
3838
augroup END
39+
# vim:sts=2:sw=2:et:

0 commit comments

Comments
 (0)