diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-04-09 11:37:38 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-09 11:37:38 +0100 |
commit | a016eeba7a5777ba1f2ec2dbcda7c96823bf9ab1 (patch) | |
tree | a2bd0a87051ffcb805cd543f37d94b528453fe50 /src/testdir/test_autocmd.vim | |
parent | 7c7e19cf50d76568e2637ad66b095044a41c6a82 (diff) | |
download | vim-git-a016eeba7a5777ba1f2ec2dbcda7c96823bf9ab1.tar.gz |
patch 8.2.4717: for TextYankPost v:event does not contain all informationv8.2.4717
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)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 3ff9d0b34..896c563f7 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -1931,28 +1931,48 @@ func Test_TextYankPost() norm "ayiw call assert_equal( - \{'regcontents': ['foo'], 'regname': 'a', 'operator': 'y', 'regtype': 'v', 'visual': v:false}, - \g:event) + \ #{regcontents: ['foo'], regname: 'a', operator: 'y', + \ regtype: 'v', visual: v:false, inclusive: v:true}, + \ g:event) norm y_ call assert_equal( - \{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype': 'V', 'visual': v:false}, - \g:event) + \ #{regcontents: ['foo'], regname: '', operator: 'y', regtype: 'V', + \ visual: v:false, inclusive: v:false}, + \ g:event) norm Vy call assert_equal( - \{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype': 'V', 'visual': v:true}, - \g:event) + \ #{regcontents: ['foo'], regname: '', operator: 'y', regtype: 'V', + \ visual: v:true, inclusive: 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) + \ #{regcontents: ['f'], regname: '', operator: 'y', regtype: "\x161", + \ visual: v:true, inclusive: v:true}, + \ g:event) norm "xciwbar call assert_equal( - \{'regcontents': ['foo'], 'regname': 'x', 'operator': 'c', 'regtype': 'v', 'visual': v:false}, - \g:event) + \ #{regcontents: ['foo'], regname: 'x', operator: 'c', regtype: 'v', + \ visual: v:false, inclusive: v:true}, + \ g:event) norm "bdiw call assert_equal( - \{'regcontents': ['bar'], 'regname': 'b', 'operator': 'd', 'regtype': 'v', 'visual': v:false}, - \g:event) + \ #{regcontents: ['bar'], regname: 'b', operator: 'd', regtype: 'v', + \ visual: v:false, inclusive: v:true}, + \ g:event) + + call setline(1, 'foobar') + " exclusive motion + norm $"ay0 + call assert_equal( + \ #{regcontents: ['fooba'], regname: 'a', operator: 'y', regtype: 'v', + \ visual: v:false, inclusive: v:false}, + \ g:event) + " inclusive motion + norm 0"ay$ + call assert_equal( + \ #{regcontents: ['foobar'], regname: 'a', operator: 'y', regtype: 'v', + \ visual: v:false, inclusive: v:true}, + \ g:event) call assert_equal({}, v:event) @@ -1965,15 +1985,17 @@ func Test_TextYankPost() set clipboard=autoselect exe "norm! ggviw\<Esc>" call assert_equal( - \{'regcontents': ['foobar'], 'regname': '*', 'operator': 'y', 'regtype': 'v', 'visual': v:true}, - \g:event) + \ #{regcontents: ['foobar'], regname: '*', operator: 'y', + \ regtype: 'v', visual: v:true, inclusive: v:false}, + \ g:event) let @+ = '' set clipboard=autoselectplus exe "norm! ggviw\<Esc>" call assert_equal( - \{'regcontents': ['foobar'], 'regname': '+', 'operator': 'y', 'regtype': 'v', 'visual': v:true}, - \g:event) + \ #{regcontents: ['foobar'], regname: '+', operator: 'y', + \ regtype: 'v', visual: v:true, inclusive: v:false}, + \ g:event) set clipboard&vim endif |