comparison src/testdir/test_paste.vim @ 10813:09eb5fd275e0 v8.0.0296

patch 8.0.0296: bracketed paste can only append, not insert commit https://github.com/vim/vim/commit/fd8983b09c64d9bfa8a4bdc16d72c55fbb22b4dc Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 2 22:21:29 2017 +0100 patch 8.0.0296: bracketed paste can only append, not insert Problem: Bracketed paste can only append, not insert. Solution: When the cursor is in the first column insert the text.
author Christian Brabandt <cb@256bit.org>
date Thu, 02 Feb 2017 22:30:04 +0100
parents 689e88afdd11
children e366b968bf08
comparison
equal deleted inserted replaced
10812:569cb89e14fe 10813:09eb5fd275e0
6 endif 6 endif
7 set term=xterm 7 set term=xterm
8 8
9 func Test_paste_normal_mode() 9 func Test_paste_normal_mode()
10 new 10 new
11 " In first column text is inserted
11 call setline(1, ['a', 'b', 'c']) 12 call setline(1, ['a', 'b', 'c'])
12 2 13 call cursor(2, 1)
13 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt') 14 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
14 call assert_equal('bfoo', getline(2)) 15 call assert_equal('foo', getline(2))
16 call assert_equal('barb', getline(3))
17 call assert_equal('c', getline(4))
18
19 " When repeating text is appended
20 normal .
21 call assert_equal('barfoo', getline(3))
22 call assert_equal('barb', getline(4))
23 call assert_equal('c', getline(5))
24 bwipe!
25
26 " In second column text is appended
27 call setline(1, ['a', 'bbb', 'c'])
28 call cursor(2, 2)
29 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
30 call assert_equal('bbfoo', getline(2))
31 call assert_equal('barb', getline(3))
32 call assert_equal('c', getline(4))
33
34 " In last column text is appended
35 call setline(1, ['a', 'bbb', 'c'])
36 call cursor(2, 3)
37 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
38 call assert_equal('bbbfoo', getline(2))
15 call assert_equal('bar', getline(3)) 39 call assert_equal('bar', getline(3))
16 call assert_equal('c', getline(4)) 40 call assert_equal('c', getline(4))
17
18 normal .
19 call assert_equal('barfoo', getline(3))
20 call assert_equal('bar', getline(4))
21 call assert_equal('c', getline(5))
22 bwipe!
23 endfunc 41 endfunc
24 42
25 func Test_paste_insert_mode() 43 func Test_paste_insert_mode()
26 new 44 new
27 call setline(1, ['a', 'b', 'c']) 45 call setline(1, ['a', 'b', 'c'])