runtime(doc): Update doc 52.6
Commit:
https://github.com/vim/vim/commit/7db96134c2bfb404f7fdbc3b1ce5e4e62b194f72
Author: Jim Zhou <[email protected]>
Date: Wed Mar 12 20:57:24 2025 +0100
runtime(doc): Update doc 52.6
Problem: the highlight-yank plugin exmaple provided in the doc behaves
incorrectly when selection is set to exclusive.
Solution: use a unified offset of 1 and pass 'exclusive: false' to
getregionpos(), while at it, also clarify when the
TextYankPost autocommand triggers.
closes: #16866
Signed-off-by: Jim Zhou <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 5c449589d..8532fc956 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 08
+*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1346,6 +1346,10 @@ TextYankPost After text has been
yanked or deleted in the
called recursively.
It is not allowed to change the buffer text,
see |textlock|. *E1064*
+ Also triggered indirectly when Vim tries to
+ become owner of the Visual selection because
+ of setting "autoselect" for 'guioptions' or
+ 'clipboard'.
{only when compiled with the +eval feature}
*User*
diff --git a/runtime/doc/usr_52.txt b/runtime/doc/usr_52.txt
index dbfd31983..6a8204d96 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 Oct 07
+*usr_52.txt* For Vim version 9.1. Last change: 2025 Mar 12
VIM USER MANUAL - by Bram Moolenaar
@@ -362,11 +362,10 @@ and it will be active next time you start Vim.
|add-plugin|: >
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 pos = getregionpos(beg, end, {type: type, exclusive: false})
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
+ var col_end = v[1][2] + v[1][3] + 1
return [v[0][1], col_beg, col_end - col_beg]
}))
var winid = win_getid()
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tsSFK-006dLt-AR%40256bit.org.