diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-04 21:34:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-04 21:34:31 +0100 |
commit | a1891848d970452cd775d35a4bccfdd9758a690a (patch) | |
tree | a4f34fe283b391afa71e8a735b10e161077e953d /src/testdir/test_paste.vim | |
parent | e353c402e63b9b0a0bc06acf390e352d9e7eeaeb (diff) | |
download | vim-git-a1891848d970452cd775d35a4bccfdd9758a690a.tar.gz |
patch 8.0.0303: bracketed paste does not work in Visual modev8.0.0303
Problem: Bracketed paste does not work in Visual mode.
Solution: Delete the text before pasting
Diffstat (limited to 'src/testdir/test_paste.vim')
-rw-r--r-- | src/testdir/test_paste.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim index f5deb7d6b..440dc7f1f 100644 --- a/src/testdir/test_paste.vim +++ b/src/testdir/test_paste.vim @@ -70,3 +70,30 @@ func Test_paste_cmdline() call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt') call assert_equal("\"afoo\<CR>barb", getreg(':')) endfunc + +func Test_paste_visual_mode() + new + call setline(1, 'here are some words') + call feedkeys("0fsve\<Esc>[200~more\<Esc>[201~", 'xt') + call assert_equal('here are more words', getline(1)) + call assert_equal('some', getreg('-')) + + " include last char in the line + call feedkeys("0fwve\<Esc>[200~noises\<Esc>[201~", 'xt') + call assert_equal('here are more noises', getline(1)) + call assert_equal('words', getreg('-')) + + " exclude last char in the line + call setline(1, 'some words!') + call feedkeys("0fwve\<Esc>[200~noises\<Esc>[201~", 'xt') + call assert_equal('some noises!', getline(1)) + call assert_equal('words', getreg('-')) + + " multi-line selection + call setline(1, ['some words', 'and more']) + call feedkeys("0fwvj0fd\<Esc>[200~letters\<Esc>[201~", 'xt') + call assert_equal('some letters more', getline(1)) + call assert_equal("words\nand", getreg('1')) + + bwipe! +endfunc |