annotate src/testdir/test_blockedit.vim @ 19783:546bdeef35f1 v8.2.0448

patch 8.2.0448: various functions not properly tested Commit: https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 22:23:46 2020 +0100 patch 8.2.0448: various functions not properly tested Problem: Various functions not properly tested. Solution: Add more tests, especially for failures. (Yegappan Lakshmanan, closes #5843)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 22:30:04 +0100
parents 70f1e352d599
children 08940efa6b4e
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
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 func Test_blockinsert_indent()
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 new
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 filetype plugin indent on
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 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
8 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
9 call cursor(2, 3)
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 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
11 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
12 \ getline(1,'$'))
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 " reset to sane state
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 filetype off
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 bwipe!
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfunc
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
13814
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
18 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
19 new
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
20 let _bs = &bs
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
21 set bs=2
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
22 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
23 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
24 "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
25 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
26 \ getline(1,'$'))
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
27 " 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
28 let &bs = _bs
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
29 bwipe!
7ed76dcf0d94 patch 8.0.1779: deleting in a block selection causes problems
Christian Brabandt <cb@256bit.org>
parents: 13620
diff changeset
30 endfunc
13620
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31
4faf77b96432 patch 8.0.1682: auto indenting breaks inserting a block
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 " vim: shiftwidth=2 sts=2 expandtab