Patch 8.2.0964
Problem: TextYankPost does not provide info about Visual selection.
Solution: Add the 'visual' key in v:event. (closes #6249)
Files: runtime/doc/autocmd.txt, src/register.c,
src/testdir/test_autocmd.vim
*** ../vim-8.2.0963/runtime/doc/autocmd.txt 2020-06-10 20:56:55.021354582
+0200
--- runtime/doc/autocmd.txt 2020-06-12 22:05:15.964105018 +0200
***************
*** 1154,1159 ****
--- 1154,1161 ----
register.
regtype Type of the register, see
|getregtype()|.
+ visual True if the operation is
+ performed on a |Visual| area.
Not triggered when |quote_| is used nor when
called recursively.
It is not allowed to change the buffer text,
*** ../vim-8.2.0963/src/register.c 2020-06-07 18:16:31.311293288 +0200
--- src/register.c 2020-06-12 22:05:15.964105018 +0200
***************
*** 928,933 ****
--- 928,935 ----
}
dict_add_string(v_event, "regtype", buf);
+ dict_add_bool(v_event, "visual", oap->is_VIsual);
+
// Lock the dictionary and its keys
dict_set_items_ro(v_event);
*** ../vim-8.2.0963/src/testdir/test_autocmd.vim 2020-06-10
20:56:55.025354576 +0200
--- src/testdir/test_autocmd.vim 2020-06-12 22:05:15.964105018 +0200
***************
*** 1712,1734 ****
norm "ayiw
call assert_equal(
! \{'regcontents': ['foo'], 'regname': 'a', 'operator': 'y', 'regtype':
'v'},
\g:event)
norm y_
call assert_equal(
! \{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype':
'V'},
\g:event)
call feedkeys("\<C-V>y", 'x')
call assert_equal(
! \{'regcontents': ['f'], 'regname': '', 'operator': 'y', 'regtype':
"\x161"},
\g:event)
norm "xciwbar
call assert_equal(
! \{'regcontents': ['foo'], 'regname': 'x', 'operator': 'c', 'regtype':
'v'},
\g:event)
norm "bdiw
call assert_equal(
! \{'regcontents': ['bar'], 'regname': 'b', 'operator': 'd', 'regtype':
'v'},
\g:event)
call assert_equal({}, v:event)
--- 1712,1738 ----
norm "ayiw
call assert_equal(
! \{'regcontents': ['foo'], 'regname': 'a', 'operator': 'y', 'regtype':
'v', 'visual': v:false},
\g:event)
norm y_
call assert_equal(
! \{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype':
'V', 'visual': v:false},
! \g:event)
! norm Vy
! call assert_equal(
! \{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype':
'V', 'visual': v:true},
\g:event)
call feedkeys("\<C-V>y", 'x')
call assert_equal(
! \{'regcontents': ['f'], 'regname': '', 'operator': 'y', 'regtype':
"\x161", 'visual': v:true},
\g:event)
norm "xciwbar
call assert_equal(
! \{'regcontents': ['foo'], 'regname': 'x', 'operator': 'c', 'regtype':
'v', 'visual': v:false},
\g:event)
norm "bdiw
call assert_equal(
! \{'regcontents': ['bar'], 'regname': 'b', 'operator': 'd', 'regtype':
'v', 'visual': v:false},
\g:event)
call assert_equal({}, v:event)
*** ../vim-8.2.0963/src/version.c 2020-06-12 20:19:37.976526305 +0200
--- src/version.c 2020-06-12 22:06:37.995676235 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 964,
/**/
--
DEAD PERSON: I'm getting better!
CUSTOMER: No, you're not -- you'll be stone dead in a moment.
MORTICIAN: Oh, I can't take him like that -- it's against regulations.
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit
https://groups.google.com/d/msgid/vim_dev/202006122009.05CK9g5r408562%40masaka.moolenaar.net.