Bram Moolenaar | c812996 | 2017-01-22 20:04:51 +0100 | [diff] [blame] | 1 | |
| 2 | func Test_put_block() |
| 3 | if !has('multi_byte') |
| 4 | return |
| 5 | endif |
| 6 | new |
| 7 | call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x') |
| 8 | call feedkeys("\<C-V>y", 'x') |
| 9 | call feedkeys("gg0p", 'x') |
| 10 | call assert_equal("\u2500x", getline(1)) |
| 11 | bwipe! |
| 12 | endfunc |
Bram Moolenaar | 9957a10 | 2017-01-23 21:53:53 +0100 | [diff] [blame] | 13 | |
| 14 | func Test_put_char_block() |
| 15 | new |
| 16 | call setline(1, ['Line 1', 'Line 2']) |
| 17 | f Xfile_put |
| 18 | " visually select both lines and put the cursor at the top of the visual |
| 19 | " selection and then put the buffer name over it |
| 20 | exe "norm! G0\<c-v>ke\"%p" |
| 21 | call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2)) |
| 22 | bw! |
| 23 | endfunc |
Bram Moolenaar | 941c12d | 2017-01-24 19:55:43 +0100 | [diff] [blame^] | 24 | |
| 25 | func Test_put_char_block2() |
| 26 | new |
| 27 | let a = [ getreg('a'), getregtype('a') ] |
| 28 | call setreg('a', ' one ', 'v') |
| 29 | call setline(1, ['Line 1', '', 'Line 3', '']) |
| 30 | " visually select the first 3 lines and put register a over it |
| 31 | exe "norm! ggl\<c-v>2j2l\"ap" |
| 32 | call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4)) |
| 33 | " clean up |
| 34 | bw! |
| 35 | call setreg('a', a[0], a[1]) |
| 36 | endfunc |