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