Mercurial > vim
annotate src/testdir/test_blockedit.vim @ 29572:fdfb36298114 v9.0.0127
patch 9.0.0127: unused variable
Commit: https://github.com/vim/vim/commit/e95f22f63a1871b91e5508088e5ae4905ce28cd7
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Aug 1 11:49:45 2022 +0100
patch 9.0.0127: unused variable
Problem: Unused variable.
Solution: Remove the variable. (closes https://github.com/vim/vim/issues/10829)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 01 Aug 2022 13:00:04 +0200 |
parents | 74e706afae3f |
children | 84ea6d876d43 |
rev | line source |
---|---|
13620
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for block inserting |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_blockinsert_indent() |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 new |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 filetype plugin indent on |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 setlocal sw=2 et ft=vim |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call setline(1, ['let a=[', ' ''eins'',', ' ''zwei'',', ' ''drei'']']) |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call cursor(2, 3) |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 exe "norm! \<c-v>2jI\\ \<esc>" |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_equal(['let a=[', ' \ ''eins'',', ' \ ''zwei'',', ' \ ''drei'']'], |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 \ getline(1,'$')) |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 " reset to sane state |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 filetype off |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 bwipe! |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endfunc |
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
26307
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
17 func Test_blockinsert_autoindent() |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
18 new |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
19 let lines =<< trim END |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
20 var d = { |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
21 a: () => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
22 b: () => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
23 c: () => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
24 } |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
25 END |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
26 call setline(1, lines) |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
27 filetype plugin indent on |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
28 setlocal sw=2 et ft=vim |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
29 setlocal indentkeys+=: |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
30 exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>" |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
31 let expected =<< trim END |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
32 var d = { |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
33 a: (): asdf => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
34 b: (): asdf => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
35 c: (): asdf => 0, |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
36 } |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
37 END |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
38 call assert_equal(expected, getline(1, 5)) |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
39 |
26313
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
40 " insert on the next column should do exactly the same |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
41 :%dele |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
42 call setline(1, lines) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
43 exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>" |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
44 call assert_equal(expected, getline(1, 5)) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
45 |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
46 :%dele |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
47 call setline(1, lines) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
48 setlocal sw=8 noet |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
49 exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>" |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
50 let expected =<< trim END |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
51 var d = { |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
52 a: (): asdf => 0, |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
53 b: (): asdf => 0, |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
54 c: (): asdf => 0, |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
55 } |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
56 END |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
57 call assert_equal(expected, getline(1, 5)) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
58 |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
59 " insert on the next column should do exactly the same |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
60 :%dele |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
61 call setline(1, lines) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
62 exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>" |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
63 call assert_equal(expected, getline(1, 5)) |
74e706afae3f
patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
26307
diff
changeset
|
64 |
26307
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
65 filetype off |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
66 bwipe! |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
67 endfunc |
294736db2561
patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents:
25072
diff
changeset
|
68 |
13814
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
69 func Test_blockinsert_delete() |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
70 new |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
71 let _bs = &bs |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
72 set bs=2 |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
73 call setline(1, ['case Arg is ', ' when Name_Async,', ' when Name_Num_Gangs,', 'end if;']) |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
74 exe "norm! ggjVj\<c-v>$o$A\<bs>\<esc>" |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
75 "call feedkeys("Vj\<c-v>$o$A\<bs>\<esc>", 'ti') |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
76 call assert_equal(["case Arg is ", " when Name_Async", " when Name_Num_Gangs,", "end if;"], |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
77 \ getline(1,'$')) |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
78 " reset to sane state |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
79 let &bs = _bs |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
80 bwipe! |
7ed76dcf0d94
patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents:
13620
diff
changeset
|
81 endfunc |
13620
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
25072
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
83 func Test_blockappend_eol_cursor() |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
84 new |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
85 " Test 1 Move 1 char left |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
86 call setline(1, ['aaa', 'bbb', 'ccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
87 exe "norm! gg$\<c-v>2jA\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
88 call assert_equal(['aaxa', 'bbxb', 'ccxc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
89 " Test 2 Move 2 chars left |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
90 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
91 call setline(1, ['aaa', 'bbb', 'ccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
92 exe "norm! gg$\<c-v>2jA\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
93 call assert_equal(['axaa', 'bxbb', 'cxcc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
94 " Test 3 Move 3 chars left (outside of the visual selection) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
95 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
96 call setline(1, ['aaa', 'bbb', 'ccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
97 exe "norm! ggl$\<c-v>2jA\<left>\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
98 call assert_equal(['xaaa', 'bbb', 'ccc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
99 bw! |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
100 endfunc |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
101 |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
102 func Test_blockappend_eol_cursor2() |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
103 new |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
104 " Test 1 Move 1 char left |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
105 call setline(1, ['aaaaa', 'bbb', 'ccccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
106 exe "norm! gg\<c-v>$2jA\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
107 call assert_equal(['aaaaxa', 'bbbx', 'ccccxc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
108 " Test 2 Move 2 chars left |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
109 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
110 call setline(1, ['aaaaa', 'bbb', 'ccccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
111 exe "norm! gg\<c-v>$2jA\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
112 call assert_equal(['aaaxaa', 'bbbx', 'cccxcc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
113 " Test 3 Move 3 chars left (to the beginning of the visual selection) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
114 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
115 call setline(1, ['aaaaa', 'bbb', 'ccccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
116 exe "norm! gg\<c-v>$2jA\<left>\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
117 call assert_equal(['aaxaaa', 'bbxb', 'ccxccc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
118 " Test 4 Move 3 chars left (outside of the visual selection) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
119 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
120 call setline(1, ['aaaaa', 'bbb', 'ccccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
121 exe "norm! ggl\<c-v>$2jA\<left>\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
122 call assert_equal(['aaxaaa', 'bbxb', 'ccxccc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
123 " Test 5 Move 4 chars left (outside of the visual selection) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
124 sil %d |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
125 call setline(1, ['aaaaa', 'bbb', 'ccccc']) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
126 exe "norm! ggl\<c-v>$2jA\<left>\<left>\<left>\<left>x\<esc>" |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
127 call assert_equal(['axaaaa', 'bxbb', 'cxcccc'], getline(1, '$')) |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
128 bw! |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
129 endfunc |
bd46322bea66
patch 8.2.3073: when cursor is move for block append wrong text is inserted
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
130 |
13620
4faf77b96432
patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 " vim: shiftwidth=2 sts=2 expandtab |