annotate src/testdir/test_blockedit.vim @ 30681:a7f174d34f85 v9.0.0675

patch 9.0.0675: search test screendump is outdated Commit: https://github.com/vim/vim/commit/851907a7ab2db84e1e93c3f7ef417cc46c5c19c7 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 6 16:33:15 2022 +0100 patch 9.0.0675: search test screendump is outdated Problem: Search test screendump is outdated. Solution: Update the screendump for improved display.
author Bram Moolenaar <Bram@vim.org>
date Thu, 06 Oct 2022 17:45:05 +0200
parents eaa79e688fb8
children dbec60b8c253
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
20 vim9script
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
21 var d = {
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
22 a: () => 0,
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
23 b: () => 0,
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
24 c: () => 0,
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
25 }
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
26 END
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
27 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
28 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
29 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
30 setlocal indentkeys+=:
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
31 exe "norm! 3Gf)\<c-v>2jA: asdf\<esc>"
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
32 let expected =<< trim END
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
33 vim9script
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
34 var d = {
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
35 a: (): asdf => 0,
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
36 b: (): asdf => 0,
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
37 c: (): asdf => 0,
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
38 }
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
39 END
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
40 call assert_equal(expected, getline(1, 6))
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
41
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
42 " 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
43 :%dele
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
44 call setline(1, lines)
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
45 exe "norm! 3Gf)l\<c-v>2jI: asdf\<esc>"
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
46 call assert_equal(expected, getline(1, 6))
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
47
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
48 :%dele
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
49 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
50 setlocal sw=8 noet
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
51 exe "norm! 3Gf)\<c-v>2jA: asdf\<esc>"
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
52 let expected =<< trim END
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
53 vim9script
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
54 var d = {
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
55 a: (): asdf => 0,
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
56 b: (): asdf => 0,
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
57 c: (): asdf => 0,
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 END
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
60 call assert_equal(expected, getline(1, 6))
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
61
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
62 " 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
63 :%dele
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
64 call setline(1, lines)
30554
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
65 exe "norm! 3Gf)l\<c-v>2jI: asdf\<esc>"
eaa79e688fb8 patch 9.0.0612: blockedit test passes with wrong result
Bram Moolenaar <Bram@vim.org>
parents: 30548
diff changeset
66 call assert_equal(expected, getline(1, 6))
26313
74e706afae3f patch 8.2.3687: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 26307
diff changeset
67
26307
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
68 filetype off
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
69 bwipe!
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
70 endfunc
294736db2561 patch 8.2.3684: blockwise insert does not handle autoindent properly
Bram Moolenaar <Bram@vim.org>
parents: 25072
diff changeset
71
13814
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
72 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
73 new
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
74 let _bs = &bs
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
75 set bs=2
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
76 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
77 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
78 "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
79 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
80 \ getline(1,'$'))
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
81 " 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
82 let &bs = _bs
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
83 bwipe!
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
84 endfunc
13620
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85
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
86 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
87 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
88 " 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
89 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
90 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
91 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
92 " 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
93 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
94 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
95 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
96 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
97 " 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
98 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
99 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
100 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
101 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
102 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
103 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
104
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 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
106 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
107 " 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
108 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
109 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
110 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
111 " 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
112 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
113 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
114 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
115 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
116 " 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
117 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
118 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
119 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
120 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
121 " 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
122 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
123 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
124 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
125 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
126 " 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
127 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
128 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
129 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
130 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
131 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
132 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
133
13620
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 " vim: shiftwidth=2 sts=2 expandtab