diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2022-01-28 16:01:13 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-28 16:01:13 +0000 |
commit | fb55207ed17918c8a2a6cadf5ad9d5fcf686a7ab (patch) | |
tree | 9faeac58af548281bea9b0f703bd2cbbdb96c380 /src/testdir/test_visual.vim | |
parent | 420fabcd4ffeaf79082a6e43db91e1d363f88f27 (diff) |
patch 8.2.4242: put in Visual mode cannot be repeatedv8.2.4242
Problem: Put in Visual mode cannot be repeated.
Solution: Use "P" to put without yanking the deleted text into the unnamed
register. (Shougo Matsushita, closes #9591)
Diffstat (limited to 'src/testdir/test_visual.vim')
-rw-r--r-- | src/testdir/test_visual.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim index af54615c48..d336f5b38a 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -1358,8 +1358,32 @@ func Test_visual_undo_deletes_last_line() exe "normal ggvjfxO" undo normal gNU + bwipe! endfunc +func Test_visual_paste() + new + + " v_p overwrites unnamed register. + call setline(1, ['xxxx']) + call setreg('"', 'foo') + call setreg('-', 'bar') + normal 1Gvp + call assert_equal(@", 'x') + call assert_equal(@-, 'x') + + if has('clipboard') + " v_P does not overwrite unnamed register. + call setline(1, ['xxxx']) + call setreg('"', 'foo') + call setreg('-', 'bar') + normal 1GvP + call assert_equal(@", 'foo') + call assert_equal(@-, 'x') + endif + + bwipe! +endfunc " vim: shiftwidth=2 sts=2 expandtab |