Bram Moolenaar | f8eb9c5 | 2017-01-02 17:31:24 +0100 | [diff] [blame] | 1 | " Tests for various Visual mode. |
Bram Moolenaar | 019b9c6 | 2016-03-05 17:26:00 +0100 | [diff] [blame] | 2 | if !has('visual') |
| 3 | finish |
| 4 | endif |
| 5 | |
| 6 | func Test_block_shift_multibyte() |
Bram Moolenaar | f8eb9c5 | 2017-01-02 17:31:24 +0100 | [diff] [blame] | 7 | " Uses double-wide character. |
| 8 | if !has('multi_byte') |
| 9 | return |
| 10 | endif |
Bram Moolenaar | 019b9c6 | 2016-03-05 17:26:00 +0100 | [diff] [blame] | 11 | split |
| 12 | call setline(1, ['xヹxxx', 'ヹxxx']) |
| 13 | exe "normal 1G0l\<C-V>jl>" |
| 14 | call assert_equal('x ヹxxx', getline(1)) |
| 15 | call assert_equal(' ヹxxx', getline(2)) |
| 16 | q! |
| 17 | endfunc |
Bram Moolenaar | f8eb9c5 | 2017-01-02 17:31:24 +0100 | [diff] [blame] | 18 | |
| 19 | func Test_dotregister_paste() |
| 20 | new |
| 21 | exe "norm! ihello world\<esc>" |
| 22 | norm! 0ve".p |
| 23 | call assert_equal('hello world world', getline(1)) |
| 24 | q! |
| 25 | endfunc |
Bram Moolenaar | 23fa81d | 2017-02-01 21:50:21 +0100 | [diff] [blame] | 26 | |
| 27 | func Test_Visual_ctrl_o() |
| 28 | new |
| 29 | call setline(1, ['one', 'two', 'three']) |
| 30 | call cursor(1,2) |
| 31 | set noshowmode |
| 32 | set tw=0 |
| 33 | call feedkeys("\<c-v>jjlIa\<c-\>\<c-o>:set tw=88\<cr>\<esc>", 'tx') |
| 34 | call assert_equal(['oane', 'tawo', 'tahree'], getline(1, 3)) |
| 35 | call assert_equal(88, &tw) |
| 36 | set tw& |
| 37 | bw! |
| 38 | endfu |
Bram Moolenaar | 84b2a38 | 2017-02-17 11:40:00 +0100 | [diff] [blame] | 39 | |
| 40 | func Test_Visual_vapo() |
| 41 | new |
| 42 | normal oxx |
| 43 | normal vapo |
| 44 | bwipe! |
| 45 | endfunc |