patch 8.2.4717: for TextYankPost v:event does not contain all information
Problem: For TextYankPost v:event does not contain information about the
operation being inclusive or not.
Solution: Add "inclusive" to v:event. (Justn M. Keyes, Yegappan Lakshmanan,
closes #10125)
diff --git a/src/register.c b/src/register.c
index 79e6021..b4e88a6 100644
--- a/src/register.c
+++ b/src/register.c
@@ -1013,20 +1013,28 @@
list = list_alloc();
if (list == NULL)
return;
+
+ // yanked text contents
for (n = 0; n < reg->y_size; n++)
list_append_string(list, reg->y_array[n], -1);
list->lv_lock = VAR_FIXED;
(void)dict_add_list(v_event, "regcontents", list);
+ // register name or empty string for unnamed operation
buf[0] = (char_u)oap->regname;
buf[1] = NUL;
(void)dict_add_string(v_event, "regname", buf);
+ // motion type: inclusive or exclusive
+ (void)dict_add_bool(v_event, "inclusive", oap->inclusive);
+
+ // kind of operation (yank, delete, change)
buf[0] = get_op_char(oap->op_type);
buf[1] = get_extra_op_char(oap->op_type);
buf[2] = NUL;
(void)dict_add_string(v_event, "operator", buf);
+ // register type
buf[0] = NUL;
buf[1] = NUL;
switch (get_reg_type(oap->regname, ®len))
@@ -1040,6 +1048,7 @@
}
(void)dict_add_string(v_event, "regtype", buf);
+ // selection type - visual or not
(void)dict_add_bool(v_event, "visual", oap->is_VIsual);
// Lock the dictionary and its keys
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 3ff9d0b..896c563 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
Binary files differ
diff --git a/src/version.c b/src/version.c
index f8f15ad..1830d5f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4717,
+/**/
4716,
/**/
4715,