blob: da143c518f659aff8c0565685d18f4610a5f6c2d [file] [log] [blame]
Bram Moolenaar9aa15692017-08-19 15:05:32 +02001" Tests for 'virtualedit'.
2
3func Test_yank_move_change()
4 split
5 call setline(1, [
6 \ "func foo() error {",
7 \ "\tif n, err := bar();",
8 \ "\terr != nil {",
9 \ "\t\treturn err",
10 \ "\t}",
11 \ "\tn = n * n",
12 \ ])
13 set virtualedit=all
14 set ts=4
15 function! MoveSelectionDown(count) abort
16 normal! m`
17 silent! exe "'<,'>move'>+".a:count
18 norm! ``
19 endfunction
20
21 xmap ]e :<C-U>call MoveSelectionDown(v:count1)<CR>
22 2
23 normal 2gg
24 normal J
25 normal jVj
26 normal ]e
27 normal ce
28 bwipe!
29 set virtualedit=
30 set ts=8
31endfunc