Skip to content

Commit d269a5a

Browse files
authored
Merge pull request #1579 from vim-jp/hh-update-usr_52
Update usr_52.{txt,jax}
2 parents d0f7b66 + b126b5d commit d269a5a

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

doc/usr_52.jax

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_52.txt* For Vim バージョン 9.1. Last change: 2024 May 31
1+
*usr_52.txt* For Vim バージョン 9.1. Last change: 2024 Jun 09
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -345,8 +345,8 @@ script ではこうしたグローバルのアイテムで確実にユニーク
345345

346346
☆comment パッケージ
347347

348-
Vim には、Vim9 script で記述されたコメントプラグイン |comment-install| が付属
349-
しています。
348+
Vim には、Vim9 script で記述されたコメントプラグインが付属しています。
349+
|comment-install|
350350
$VIMRUNTIME/pack/dist/opt/comment/ にあるパッケージを確認してください。
351351

352352
☆highlight-yank プラグイン
@@ -355,27 +355,27 @@ $VIMRUNTIME/pack/dist/opt/comment/ にあるパッケージを確認してくだ
355355
で使用可能な |getregionpos()| 関数を使用します。
356356

357357
以下の例を新しいファイルにコピーしてプラグインディレクトリに配置すると、次回
358-
Vim を起動したときにアクティブになります |add-plugin|: >
358+
Vim を起動したときにアクティブになります|add-plugin|: >
359359
360360
vim9script
361361
362362
def HighlightedYank(hlgroup = 'IncSearch', duration = 300, in_visual = true)
363363
if v:event.operator ==? 'y'
364-
if !in_visual && visualmode() != null_string
365-
visualmode(1)
366-
return
367-
endif
368-
var [beg, end] = [getpos("'["), getpos("']")]
369-
var type = v:event.regtype ?? 'v'
370-
var pos = getregionpos(beg, end, {type: type})
371-
var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
372-
var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
373-
var col_beg = v[0][2] + v[0][3]
374-
var col_end = v[1][2] + v[1][3] + end_offset
375-
return [v[0][1], col_beg, col_end - col_beg]
376-
}))
377-
var winid = win_getid()
378-
timer_start(duration, (_) => m->matchdelete(winid))
364+
if !in_visual && visualmode() != null_string
365+
visualmode(1)
366+
return
367+
endif
368+
var [beg, end] = [getpos("'["), getpos("']")]
369+
var type = v:event.regtype ?? 'v'
370+
var pos = getregionpos(beg, end, {type: type})
371+
var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
372+
var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
373+
var col_beg = v[0][2] + v[0][3]
374+
var col_end = v[1][2] + v[1][3] + end_offset
375+
return [v[0][1], col_beg, col_end - col_beg]
376+
}))
377+
var winid = win_getid()
378+
timer_start(duration, (_) => m->matchdelete(winid))
379379
endif
380380
enddef
381381

en/usr_52.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_52.txt* For Vim version 9.1. Last change: 2024 May 31
1+
*usr_52.txt* For Vim version 9.1. Last change: 2024 Jun 09
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -341,7 +341,7 @@ will have to make sure to use a unique name for these global items. Example: >
341341

342342
COMMENT PACKAGE
343343

344-
Vim comes with a comment plugin, written in Vim9 script |comment-install|.
344+
Vim comes with a comment plugin, written in Vim9 script. |comment-install|
345345
Have a look at the package located at $VIMRUNTIME/pack/dist/opt/comment/
346346

347347
HIGHLIGHT YANK PLUGIN
@@ -350,27 +350,27 @@ Here is an example for highlighting the yanked region. It makes use of the
350350
|getregionpos()| function, available since Vim 9.1.0446.
351351

352352
Copy the following example into a new file and place it into your plugin directory
353-
and it will be active next time you start Vim |add-plugin|: >
353+
and it will be active next time you start Vim. |add-plugin|: >
354354
355355
vim9script
356356
357357
def HighlightedYank(hlgroup = 'IncSearch', duration = 300, in_visual = true)
358358
if v:event.operator ==? 'y'
359-
if !in_visual && visualmode() != null_string
360-
visualmode(1)
361-
return
362-
endif
363-
var [beg, end] = [getpos("'["), getpos("']")]
364-
var type = v:event.regtype ?? 'v'
365-
var pos = getregionpos(beg, end, {type: type})
366-
var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
367-
var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
368-
var col_beg = v[0][2] + v[0][3]
369-
var col_end = v[1][2] + v[1][3] + end_offset
370-
return [v[0][1], col_beg, col_end - col_beg]
371-
}))
372-
var winid = win_getid()
373-
timer_start(duration, (_) => m->matchdelete(winid))
359+
if !in_visual && visualmode() != null_string
360+
visualmode(1)
361+
return
362+
endif
363+
var [beg, end] = [getpos("'["), getpos("']")]
364+
var type = v:event.regtype ?? 'v'
365+
var pos = getregionpos(beg, end, {type: type})
366+
var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
367+
var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
368+
var col_beg = v[0][2] + v[0][3]
369+
var col_end = v[1][2] + v[1][3] + end_offset
370+
return [v[0][1], col_beg, col_end - col_beg]
371+
}))
372+
var winid = win_getid()
373+
timer_start(duration, (_) => m->matchdelete(winid))
374374
endif
375375
enddef
376376

0 commit comments

Comments
 (0)