runtime(doc): Fix small style issues
closes: #14942
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/usr_52.txt b/runtime/doc/usr_52.txt
index 553ed88..d5062e2 100644
--- a/runtime/doc/usr_52.txt
+++ b/runtime/doc/usr_52.txt
@@ -1,4 +1,4 @@
-*usr_52.txt* For Vim version 9.1. Last change: 2024 May 31
+*usr_52.txt* For Vim version 9.1. Last change: 2024 Jun 09
VIM USER MANUAL - by Bram Moolenaar
@@ -341,7 +341,7 @@
COMMENT PACKAGE
-Vim comes with a comment plugin, written in Vim9 script |comment-install|.
+Vim comes with a comment plugin, written in Vim9 script. |comment-install|
Have a look at the package located at $VIMRUNTIME/pack/dist/opt/comment/
HIGHLIGHT YANK PLUGIN
@@ -350,27 +350,27 @@
|getregionpos()| function, available since Vim 9.1.0446.
Copy the following example into a new file and place it into your plugin directory
-and it will be active next time you start Vim |add-plugin|: >
+and it will be active next time you start Vim. |add-plugin|: >
vim9script
def HighlightedYank(hlgroup = 'IncSearch', duration = 300, in_visual = true)
if v:event.operator ==? 'y'
- if !in_visual && visualmode() != null_string
- visualmode(1)
- return
- endif
- var [beg, end] = [getpos("'["), getpos("']")]
- var type = v:event.regtype ?? 'v'
- var pos = getregionpos(beg, end, {type: type})
- var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
- var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
- var col_beg = v[0][2] + v[0][3]
- var col_end = v[1][2] + v[1][3] + end_offset
- return [v[0][1], col_beg, col_end - col_beg]
- }))
- var winid = win_getid()
- timer_start(duration, (_) => m->matchdelete(winid))
+ if !in_visual && visualmode() != null_string
+ visualmode(1)
+ return
+ endif
+ var [beg, end] = [getpos("'["), getpos("']")]
+ var type = v:event.regtype ?? 'v'
+ var pos = getregionpos(beg, end, {type: type})
+ var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
+ var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
+ var col_beg = v[0][2] + v[0][3]
+ var col_end = v[1][2] + v[1][3] + end_offset
+ return [v[0][1], col_beg, col_end - col_beg]
+ }))
+ var winid = win_getid()
+ timer_start(duration, (_) => m->matchdelete(winid))
endif
enddef