annotate src/testdir/test_registers.vim @ 27418:6ecfb8d99353 v8.2.4237

patch 8.2.4237: record buffer wrong if character in Select mode was not typed Commit: https://github.com/vim/vim/commit/fbf4f1ca159028382eaeb3bfc31bb6bb96dbb67a Author: zeertzjq <zeertzjq@outlook.com> Date: Fri Jan 28 12:50:43 2022 +0000 patch 8.2.4237: record buffer wrong if character in Select mode was not typed Problem: Record buffer wrong if character in Select mode was not typed. Solution: Only delete the tail from the record buffer if the character was typed. (closes #9650)
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Jan 2022 14:00:04 +0100
parents 5d6774c0df4f
children 390dfc3e409b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
1 " Tests for register operations
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
2
18784
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
3 source check.vim
21246
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
4 source view_util.vim
18784
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
5
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
6 " This test must be executed first to check for empty and unset registers.
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
7 func Test_aaa_empty_reg_test()
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
8 call assert_fails('normal @@', 'E748:')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
9 call assert_fails('normal @%', 'E354:')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
10 call assert_fails('normal @#', 'E354:')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
11 call assert_fails('normal @!', 'E354:')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
12 call assert_fails('normal @:', 'E30:')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
13 call assert_fails('normal @.', 'E29:')
18771
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
14 call assert_fails('put /', 'E35:')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
15 call assert_fails('put .', 'E29:')
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
16 endfunc
11682
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 func Test_yank_shows_register()
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 enew
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 set report=0
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call setline(1, ['foo', 'bar'])
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " Line-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 exe 'norm! yy'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal('1 line yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 exe 'norm! "zyy'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call assert_equal('1 line yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 exe 'norm! yj'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call assert_equal('2 lines yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 exe 'norm! "zyj'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_equal('2 lines yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 " Block-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 exe "norm! \<C-V>y"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 call assert_equal('block of 1 line yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 exe "norm! \<C-V>\"zy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call assert_equal('block of 1 line yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 exe "norm! \<C-V>jy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal('block of 2 lines yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 exe "norm! \<C-V>j\"zy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 call assert_equal('block of 2 lines yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 bwipe!
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 endfunc
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
44
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
45 func Test_display_registers()
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
46 e file1
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
47 e file2
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
48 call setline(1, ['foo', 'bar'])
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
49 /bar
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
50 exe 'norm! y2l"axx'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
51 call feedkeys("i\<C-R>=2*4\n\<esc>")
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
52 call feedkeys(":ls\n", 'xt')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
53
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
54 let a = execute('display')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
55 let b = execute('registers')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
56
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
57 call assert_equal(a, b)
18436
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
58 call assert_match('^\nType Name Content\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
59 \ . ' c "" a\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
60 \ . ' c "0 ba\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
61 \ . ' c "a b\n'
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
62 \ . '.*'
18436
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
63 \ . ' c "- a\n'
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
64 \ . '.*'
18436
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
65 \ . ' c ": ls\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
66 \ . ' c "% file2\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
67 \ . ' c "# file1\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
68 \ . ' c "/ bar\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
69 \ . ' c "= 2\*4', a)
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
70
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
71 let a = execute('registers a')
18436
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
72 call assert_match('^\nType Name Content\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
73 \ . ' c "a b', a)
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
74
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
75 let a = execute('registers :')
18436
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
76 call assert_match('^\nType Name Content\n'
6ec1bfb4690b patch 8.1.2212: cannot see the selection type in :reg output
Bram Moolenaar <Bram@vim.org>
parents: 16784
diff changeset
77 \ . ' c ": ls', a)
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
78
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
79 bwipe!
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
80 endfunc
15987
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
81
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
82 func Test_register_one()
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
83 " delete a line goes into register one
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
84 new
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
85 call setline(1, "one")
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
86 normal dd
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
87 call assert_equal("one\n", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
88
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
89 " delete a word does not change register one, does change "-
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
90 call setline(1, "two")
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
91 normal de
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
92 call assert_equal("one\n", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
93 call assert_equal("two", @-)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
94
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
95 " delete a word with a register does not change register one
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
96 call setline(1, "three")
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
97 normal "ade
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
98 call assert_equal("three", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
99 call assert_equal("one\n", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
100
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
101 " delete a word with register DOES change register one with one of a list of
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
102 " operators
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
103 " %
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
104 call setline(1, ["(12)3"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
105 normal "ad%
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
106 call assert_equal("(12)", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
107 call assert_equal("(12)", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
108
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
109 " (
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
110 call setline(1, ["first second"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
111 normal $"ad(
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
112 call assert_equal("first secon", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
113 call assert_equal("first secon", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
114
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
115 " )
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
116 call setline(1, ["First Second."])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
117 normal gg0"ad)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
118 call assert_equal("First Second.", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
119 call assert_equal("First Second.", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
120
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
121 " `
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
122 call setline(1, ["start here."])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
123 normal gg0fhmx0"ad`x
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
124 call assert_equal("start ", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
125 call assert_equal("start ", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
126
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
127 " /
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
128 call setline(1, ["searchX"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
129 exe "normal gg0\"ad/X\<CR>"
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
130 call assert_equal("search", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
131 call assert_equal("search", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
132
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
133 " ?
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
134 call setline(1, ["Ysearch"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
135 exe "normal gg$\"ad?Y\<CR>"
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
136 call assert_equal("Ysearc", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
137 call assert_equal("Ysearc", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
138
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
139 " n
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
140 call setline(1, ["Ynext"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
141 normal gg$"adn
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
142 call assert_equal("Ynex", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
143 call assert_equal("Ynex", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
144
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
145 " N
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
146 call setline(1, ["prevY"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
147 normal gg0"adN
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
148 call assert_equal("prev", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
149 call assert_equal("prev", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
150
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
151 " }
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
152 call setline(1, ["one", ""])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
153 normal gg0"ad}
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
154 call assert_equal("one\n", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
155 call assert_equal("one\n", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
156
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
157 " {
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
158 call setline(1, ["", "two"])
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
159 normal 2G$"ad{
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
160 call assert_equal("\ntw", @a)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
161 call assert_equal("\ntw", @1)
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
162
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
163 bwipe!
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
164 endfunc
15995
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
165
21246
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
166 func Test_recording_status_in_ex_line()
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
167 norm qx
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
168 redraw!
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
169 call assert_equal('recording @x', Screenline(&lines))
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
170 set shortmess=q
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
171 redraw!
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
172 call assert_equal('recording', Screenline(&lines))
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
173 set shortmess&
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
174 norm q
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
175 redraw!
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
176 call assert_equal('', Screenline(&lines))
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
177 endfunc
ce655819d9ec patch 8.2.1174: no test for the "recording @x" message
Bram Moolenaar <Bram@vim.org>
parents: 21238
diff changeset
178
15995
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
179 " Check that replaying a typed sequence does not use an Esc and following
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
180 " characters as an escape sequence.
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
181 func Test_recording_esc_sequence()
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
182 new
15999
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
183 try
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
184 let save_F2 = &t_F2
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
185 catch
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
186 endtry
15995
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
187 let t_F2 = "\<Esc>OQ"
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
188 call feedkeys("qqiTest\<Esc>", "xt")
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
189 call feedkeys("OQuirk\<Esc>q", "xt")
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
190 call feedkeys("Go\<Esc>@q", "xt")
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
191 call assert_equal(['Quirk', 'Test', 'Quirk', 'Test'], getline(1, 4))
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
192 bwipe!
15999
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
193 if exists('save_F2')
16784
62d84ef82f96 patch 8.1.1394: not restoring t_F2 in registers test
Bram Moolenaar <Bram@vim.org>
parents: 16376
diff changeset
194 let &t_F2 = save_F2
16376
3b5d401a58ce patch 8.1.1193: typos and small problems in test files
Bram Moolenaar <Bram@vim.org>
parents: 15999
diff changeset
195 else
3b5d401a58ce patch 8.1.1193: typos and small problems in test files
Bram Moolenaar <Bram@vim.org>
parents: 15999
diff changeset
196 set t_F2=
15999
f4c282082ec8 patch 8.1.1005: test fails because t_F2 is not set
Bram Moolenaar <Bram@vim.org>
parents: 15995
diff changeset
197 endif
15995
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
198 endfunc
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
199
26929
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
200 func Test_recording_with_select_mode()
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
201 new
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
202 call feedkeys("qacc12345\<Esc>gH98765\<Esc>q", "tx")
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
203 call assert_equal("98765", getline(1))
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
204 call assert_equal("cc12345\<Esc>gH98765\<Esc>", @a)
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
205 call setline(1, 'asdf')
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
206 normal! @a
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
207 call assert_equal("98765", getline(1))
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
208 bwipe!
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
209 endfunc
9975bd408d6c patch 8.2.3993: when recording a change in Select mode char appears twice
Bram Moolenaar <Bram@vim.org>
parents: 25808
diff changeset
210
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
211 " Test for executing the last used register (@)
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
212 func Test_last_used_exec_reg()
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
213 " Test for the @: command
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
214 let a = ''
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
215 call feedkeys(":let a ..= 'Vim'\<CR>", 'xt')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
216 normal @:
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
217 call assert_equal('VimVim', a)
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
218
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
219 " Test for the @= command
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
220 let x = ''
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
221 let a = ":let x ..= 'Vim'\<CR>"
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
222 exe "normal @=a\<CR>"
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
223 normal @@
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
224 call assert_equal('VimVim', x)
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
225
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
226 " Test for the @. command
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
227 let a = ''
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
228 call feedkeys("i:let a ..= 'Edit'\<CR>", 'xt')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
229 normal @.
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
230 normal @@
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
231 call assert_equal('EditEdit', a)
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
232
18771
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
233 " Test for repeating the last command-line in visual mode
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
234 call append(0, 'register')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
235 normal gg
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
236 let @r = ''
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
237 call feedkeys("v:yank R\<CR>", 'xt')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
238 call feedkeys("v@:", 'xt')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
239 call assert_equal("\nregister\nregister\n", @r)
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
240
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
241 enew!
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
242 endfunc
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
243
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
244 func Test_get_register()
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
245 enew
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
246 edit Xfile1
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
247 edit Xfile2
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
248 call assert_equal('Xfile2', getreg('%'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
249 call assert_equal('Xfile1', getreg('#'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
250
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
251 call feedkeys("iTwo\<Esc>", 'xt')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
252 call assert_equal('Two', getreg('.'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
253 call assert_equal('', getreg('_'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
254 call assert_beeps('normal ":yy')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
255 call assert_beeps('normal "%yy')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
256 call assert_beeps('normal ".yy')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
257
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
258 call assert_equal('', getreg("\<C-F>"))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
259 call assert_equal('', getreg("\<C-W>"))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
260 call assert_equal('', getreg("\<C-L>"))
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
261 " Change the last used register to '"' for the next test
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
262 normal! ""yy
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
263 let @" = 'happy'
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
264 call assert_equal('happy', getreg())
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
265 call assert_equal('happy', getreg(''))
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
266
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
267 call assert_equal('', getregtype('!'))
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
268 call assert_fails('echo getregtype([])', 'E730:')
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
269 call assert_equal('v', getregtype())
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
270 call assert_equal('v', getregtype(''))
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
271
18771
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
272 " Test for inserting an invalid register content
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
273 call assert_beeps('exe "normal i\<C-R>!"')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
274
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
275 " Test for inserting a register with multiple lines
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
276 call deletebufline('', 1, '$')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
277 call setreg('r', ['a', 'b'])
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
278 exe "normal i\<C-R>r"
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
279 call assert_equal(['a', 'b', ''], getline(1, '$'))
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
280
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
281 " Test for inserting a multi-line register in the command line
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
282 call feedkeys(":\<C-R>r\<Esc>", 'xt')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
283 call assert_equal("a\rb\r", histget(':', -1))
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
284
20178
2fb397573541 patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents: 19783
diff changeset
285 call assert_fails('let r = getreg("=", [])', 'E745:')
2fb397573541 patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents: 19783
diff changeset
286 call assert_fails('let r = getreg("=", 1, [])', 'E745:')
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
287 enew!
22502
1503ecd54f8a patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 22476
diff changeset
288
1503ecd54f8a patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 22476
diff changeset
289 " Using a register in operator-pending mode should fail
1503ecd54f8a patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 22476
diff changeset
290 call assert_beeps('norm! c"')
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
291 endfunc
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
292
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
293 func Test_set_register()
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
294 call assert_fails("call setreg('#', 200)", 'E86:')
24695
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
295 call assert_fails("call setreg('a', test_unknown())", 'E908:')
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
296
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
297 edit Xfile_alt_1
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
298 let b1 = bufnr('')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
299 edit Xfile_alt_2
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
300 let b2 = bufnr('')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
301 edit Xfile_alt_3
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
302 let b3 = bufnr('')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
303 call setreg('#', 'alt_1')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
304 call assert_equal('Xfile_alt_1', getreg('#'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
305 call setreg('#', b2)
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
306 call assert_equal('Xfile_alt_2', getreg('#'))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
307
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
308 let ab = 'regwrite'
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
309 call setreg('=', '')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
310 call setreg('=', 'a', 'a')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
311 call setreg('=', 'b', 'a')
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
312 call assert_equal('regwrite', getreg('='))
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
313
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 18784
diff changeset
314 " Test for setting a list of lines to special registers
18771
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
315 call setreg('/', [])
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
316 call assert_equal('', @/)
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
317 call setreg('=', [])
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
318 call assert_equal('', @=)
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
319 call assert_fails("call setreg('/', ['a', 'b'])", 'E883:')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
320 call assert_fails("call setreg('=', ['a', 'b'])", 'E883:')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
321 call assert_equal(0, setreg('_', ['a', 'b']))
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
322
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
323 " Test for recording to a invalid register
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
324 call assert_beeps('normal q$')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
325
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
326 " Appending to a register when recording
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
327 call append(0, "text for clipboard test")
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
328 normal gg
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
329 call feedkeys('qrllq', 'xt')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
330 call feedkeys('qRhhq', 'xt')
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
331 call assert_equal('llhh', getreg('r'))
50fde4e20790 patch 8.1.2375: no suffucient testing for registers
Bram Moolenaar <Bram@vim.org>
parents: 18755
diff changeset
332
18784
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
333 " Appending a list of characters to a register from different lines
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
334 let @r = ''
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
335 call append(0, ['abcdef', '123456'])
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
336 normal gg"ry3l
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
337 call cursor(2, 4)
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
338 normal "Ry3l
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
339 call assert_equal('abc456', @r)
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
340
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
341 " Test for gP with multiple lines selected using characterwise motion
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
342 %delete
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
343 call append(0, ['vim editor', 'vim editor'])
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
344 let @r = ''
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
345 exe "normal ggwy/vim /e\<CR>gP"
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
346 call assert_equal(['vim editor', 'vim editor', 'vim editor'], getline(1, 3))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
347
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
348 " Test for gP with . register
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
349 %delete
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
350 normal iabc
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
351 normal ".gp
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
352 call assert_equal('abcabc', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
353 normal 0".gP
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
354 call assert_equal('abcabcabc', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
355
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
356 let @"=''
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
357 call setreg('', '1')
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
358 call assert_equal('1', @")
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
359 call setreg('@', '2')
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
360 call assert_equal('2', @")
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
361
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
362 enew!
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
363 endfunc
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
364
18784
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
365 " Test for clipboard registers (* and +)
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
366 func Test_clipboard_regs()
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
367 CheckNotGui
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
368 CheckFeature clipboard_working
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
369
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
370 new
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
371 call append(0, "text for clipboard test")
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
372 normal gg"*yiw
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
373 call assert_equal('text', getreg('*'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
374 normal gg2w"+yiw
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
375 call assert_equal('clipboard', getreg('+'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
376
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
377 " Test for replacing the clipboard register contents
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
378 set clipboard=unnamed
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
379 let @* = 'food'
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
380 normal ggviw"*p
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
381 call assert_equal('text', getreg('*'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
382 call assert_equal('food for clipboard test', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
383 normal ggviw"*p
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
384 call assert_equal('food', getreg('*'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
385 call assert_equal('text for clipboard test', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
386
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
387 " Test for replacing the selection register contents
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
388 set clipboard=unnamedplus
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
389 let @+ = 'food'
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
390 normal ggviw"+p
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
391 call assert_equal('text', getreg('+'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
392 call assert_equal('food for clipboard test', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
393 normal ggviw"+p
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
394 call assert_equal('food', getreg('+'))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
395 call assert_equal('text for clipboard test', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
396
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
397 " Test for auto copying visually selected text to clipboard register
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
398 call setline(1, "text for clipboard test")
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
399 let @* = ''
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
400 set clipboard=autoselect
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
401 normal ggwwviwy
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
402 call assert_equal('clipboard', @*)
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
403
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
404 " Test for auto copying visually selected text to selection register
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
405 let @+ = ''
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
406 set clipboard=autoselectplus
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
407 normal ggwviwy
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
408 call assert_equal('for', @+)
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
409
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
410 set clipboard&vim
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
411 bwipe!
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
412 endfunc
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
413
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
414 " Test for restarting the current mode (insert or virtual replace) after
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
415 " executing the contents of a register
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
416 func Test_put_reg_restart_mode()
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
417 new
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
418 call append(0, 'editor')
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
419 normal gg
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
420 let @r = "ivim \<Esc>"
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
421 call feedkeys("i\<C-O>@r\<C-R>=mode()\<CR>", 'xt')
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
422 call assert_equal('vimi editor', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
423
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
424 call setline(1, 'editor')
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
425 normal gg
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
426 call feedkeys("gR\<C-O>@r\<C-R>=mode()\<CR>", 'xt')
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
427 call assert_equal('vimReditor', getline(1))
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
428
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
429 bwipe!
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
430 endfunc
7b57a80f70f6 patch 8.1.2381: not all register related code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 18771
diff changeset
431
19425
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
432 " Test for executing a register using :@ command
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
433 func Test_execute_register()
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
434 call setreg('r', [])
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
435 call assert_beeps('@r')
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
436 let i = 1
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
437 let @q = 'let i+= 1'
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
438 @q
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
439 @
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
440 call assert_equal(3, i)
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19425
diff changeset
441
22476
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
442 " try to execute expression register and use a backspace to cancel it
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
443 new
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
444 call feedkeys("@=\<BS>ax\<CR>y", 'xt')
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
445 call assert_equal(['x', 'y'], getline(1, '$'))
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
446 close!
b3751f4d3b26 patch 8.2.1786: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
447
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19425
diff changeset
448 " cannot execute a register in operator pending mode
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19425
diff changeset
449 call assert_beeps('normal! c@r')
19425
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
450 endfunc
67fbe280a502 patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
451
20743
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
452 " Test for getting register info
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
453 func Test_get_reginfo()
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
454 enew
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
455 call setline(1, ['foo', 'bar'])
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
456
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
457 exe 'norm! "zyy'
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
458 let info = getreginfo('"')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
459 call assert_equal('z', info.points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
460 call setreg('y', 'baz')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
461 call assert_equal('z', getreginfo('').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
462 call setreg('y', { 'isunnamed': v:true })
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
463 call assert_equal('y', getreginfo('"').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
464
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
465 exe '$put'
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
466 call assert_equal(getreg('y'), getline(3))
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
467 call setreg('', 'qux')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
468 call assert_equal('0', getreginfo('').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
469 call setreg('x', 'quux')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
470 call assert_equal('0', getreginfo('').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
471
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
472 let info = getreginfo('')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
473 call assert_equal(getreg('', 1, 1), info.regcontents)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
474 call assert_equal(getregtype(''), info.regtype)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
475
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
476 exe "norm! 0\<c-v>e" .. '"zy'
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
477 let info = getreginfo('z')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
478 call assert_equal(getreg('z', 1, 1), info.regcontents)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
479 call assert_equal(getregtype('z'), info.regtype)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
480 call assert_equal(1, +info.isunnamed)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
481
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
482 let info = getreginfo('"')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
483 call assert_equal('z', info.points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
484
24695
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
485 let @a="a1b2"
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
486 nnoremap <F2> <Cmd>let g:RegInfo = getreginfo()<CR>
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
487 exe "normal \"a\<F2>"
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
488 call assert_equal({'regcontents': ['a1b2'], 'isunnamed': v:false,
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
489 \ 'regtype': 'v'}, g:RegInfo)
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
490 nunmap <F2>
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
491 unlet g:RegInfo
13efbfc53054 patch 8.2.2886: various pieces of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24134
diff changeset
492
20743
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
493 bwipe!
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
494 endfunc
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
495
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
496 " Test for restoring register with dict from getreginfo
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
497 func Test_set_register_dict()
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
498 enew!
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
499
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
500 call setreg('"', #{ regcontents: ['one', 'two'],
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
501 \ regtype: 'V', points_to: 'z' })
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
502 call assert_equal(['one', 'two'], getreg('"', 1, 1))
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
503 let info = getreginfo('"')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
504 call assert_equal('z', info.points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
505 call assert_equal('V', info.regtype)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
506 call assert_equal(1, +getreginfo('z').isunnamed)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
507
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
508 call setreg('x', #{ regcontents: ['three', 'four'],
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
509 \ regtype: 'v', isunnamed: v:true })
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
510 call assert_equal(['three', 'four'], getreg('"', 1, 1))
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
511 let info = getreginfo('"')
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
512 call assert_equal('x', info.points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
513 call assert_equal('v', info.regtype)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
514 call assert_equal(1, +getreginfo('x').isunnamed)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
515
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
516 call setreg('y', #{ regcontents: 'five',
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
517 \ regtype: "\<c-v>", isunnamed: v:false })
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
518 call assert_equal("\<c-v>4", getreginfo('y').regtype)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
519 call assert_equal(0, +getreginfo('y').isunnamed)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
520 call assert_equal(['three', 'four'], getreg('"', 1, 1))
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
521 call assert_equal('x', getreginfo('"').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
522
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
523 call setreg('"', #{ regcontents: 'six' })
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
524 call assert_equal('0', getreginfo('"').points_to)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
525 call assert_equal(1, +getreginfo('0').isunnamed)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
526 call assert_equal(['six'], getreginfo('0').regcontents)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
527 call assert_equal(['six'], getreginfo('"').regcontents)
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
528
20968
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
529 let @x = 'one'
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
530 call setreg('x', {})
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
531 call assert_equal(1, len(split(execute('reg x'), '\n')))
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
532
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
533 call assert_fails("call setreg('0', #{regtype: 'V'}, 'v')", 'E118:')
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
534 call assert_fails("call setreg('0', #{regtype: 'X'})", 'E475:')
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
535 call assert_fails("call setreg('0', #{regtype: 'vy'})", 'E475:')
1c36b96522ae patch 8.2.1035: setreg() does not always clear the register
Bram Moolenaar <Bram@vim.org>
parents: 20891
diff changeset
536
20743
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
537 bwipe!
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
538 endfunc
a672feb8fc4f patch 8.2.0924: cannot save and restore a register properly
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
539
20754
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
540 func Test_v_register()
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
541 enew
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
542 call setline(1, 'nothing')
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
543
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
544 func s:Put()
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
545 let s:register = v:register
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
546 exec 'normal! "' .. v:register .. 'P'
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
547 endfunc
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
548 nnoremap <buffer> <plug>(test) :<c-u>call s:Put()<cr>
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
549 nmap <buffer> S <plug>(test)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
550
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
551 let @z = "testz\n"
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
552 let @" = "test@\n"
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
553
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
554 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
555 call feedkeys('"_ddS', 'mx')
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
556 call assert_equal('test@', getline('.')) " fails before 8.2.0929
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
557 call assert_equal('"', s:register) " fails before 8.2.0929
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
558
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
559 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
560 call feedkeys('"zS', 'mx')
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
561 call assert_equal('z', s:register)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
562
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
563 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
564 call feedkeys('"zSS', 'mx')
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
565 call assert_equal('"', s:register)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
566
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
567 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
568 call feedkeys('"_S', 'mx')
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
569 call assert_equal('_', s:register)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
570
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
571 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
572 normal "_ddS
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
573 call assert_equal('"', s:register) " fails before 8.2.0929
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
574 call assert_equal('test@', getline('.')) " fails before 8.2.0929
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
575
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
576 let s:register = ''
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
577 execute 'normal "z:call' "s:Put()\n"
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
578 call assert_equal('z', s:register)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
579 call assert_equal('testz', getline('.'))
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
580
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
581 " Test operator and omap
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
582 let @b = 'testb'
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
583 func s:OpFunc(...)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
584 let s:register2 = v:register
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
585 endfunc
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
586 set opfunc=s:OpFunc
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
587
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
588 normal "bg@l
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
589 normal S
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
590 call assert_equal('"', s:register) " fails before 8.2.0929
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
591 call assert_equal('b', s:register2)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
592
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
593 func s:Motion()
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
594 let s:register1 = v:register
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
595 normal! l
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
596 endfunc
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
597 onoremap <buffer> Q :<c-u>call s:Motion()<cr>
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
598
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
599 normal "bg@Q
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
600 normal S
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
601 call assert_equal('"', s:register)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
602 call assert_equal('b', s:register1)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
603 call assert_equal('"', s:register2)
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
604
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
605 set opfunc&
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
606 bwipe!
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
607 endfunc
e6a5a5ef4034 patch 8.2.0929: v:register is not cleared after an operator was executed
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
608
20891
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
609 " Test for executing the contents of a register as an Ex command with line
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
610 " continuation.
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
611 func Test_execute_reg_as_ex_cmd()
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
612 " Line continuation with just two lines
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
613 let code =<< trim END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
614 let l = [
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
615 \ 1]
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
616 END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
617 let @r = code->join("\n")
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
618 let l = []
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
619 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
620 call assert_equal([1], l)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
621
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
622 " Line continuation with more than two lines
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
623 let code =<< trim END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
624 let l = [
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
625 \ 1,
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
626 \ 2,
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
627 \ 3]
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
628 END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
629 let @r = code->join("\n")
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
630 let l = []
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
631 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
632 call assert_equal([1, 2, 3], l)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
633
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
634 " use comments interspersed with code
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
635 let code =<< trim END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
636 let l = [
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
637 "\ one
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
638 \ 1,
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
639 "\ two
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
640 \ 2,
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
641 "\ three
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
642 \ 3]
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
643 END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
644 let @r = code->join("\n")
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
645 let l = []
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
646 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
647 call assert_equal([1, 2, 3], l)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
648
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
649 " use line continuation in the middle
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
650 let code =<< trim END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
651 let a = "one"
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
652 let l = [
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
653 \ 1,
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
654 \ 2]
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
655 let b = "two"
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
656 END
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
657 let @r = code->join("\n")
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
658 let l = []
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
659 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
660 call assert_equal([1, 2], l)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
661 call assert_equal("one", a)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
662 call assert_equal("two", b)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
663
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
664 " only one line with a \
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
665 let @r = "\\let l = 1"
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
666 call assert_fails('@r', 'E10:')
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
667
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
668 " only one line with a "\
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
669 let @r = ' "\ let i = 1'
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
670 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
671 call assert_false(exists('i'))
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
672
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
673 " first line also begins with a \
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
674 let @r = "\\let l = [\n\\ 1]"
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
675 call assert_fails('@r', 'E10:')
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
676
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
677 " Test with a large number of lines
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
678 let @r = "let str = \n"
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
679 let @r ..= repeat(" \\ 'abcdefghijklmnopqrstuvwxyz' ..\n", 312)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
680 let @r ..= ' \ ""'
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
681 @r
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
682 call assert_equal(repeat('abcdefghijklmnopqrstuvwxyz', 312), str)
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
683 endfunc
4bdc07beeadb patch 8.2.0997: cannot execute a register containing line continuation
Bram Moolenaar <Bram@vim.org>
parents: 20754
diff changeset
684
20976
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
685 " Test for clipboard registers with ASCII NUL
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
686 func Test_clipboard_nul()
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
687 CheckFeature clipboard_working
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
688 new
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
689
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
690 " Test for putting ASCII NUL into the clipboard
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
691 set clipboard=unnamed
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
692 call append(0, "\ntest")
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
693 normal ggyyp
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
694 call assert_equal("^@test^@", strtrans(getreg('*')))
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
695 call assert_equal(getline(1), getline(2))
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
696 let b = split(execute(":reg *"), "\n")
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
697 call assert_match('"\*\s*\^@test\^J',b[1])
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
698
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
699 set clipboard&vim
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
700 bwipe!
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
701 endfunc
599b29b6e540 patch 8.2.1039: cannot put NUL byte on clipboard
Bram Moolenaar <Bram@vim.org>
parents: 20968
diff changeset
702
21238
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
703 func Test_ve_blockpaste()
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
704 new
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
705 set ve=all
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
706 0put =['QWERTZ','ASDFGH']
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
707 call cursor(1,1)
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
708 exe ":norm! \<C-V>3ljdP"
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
709 call assert_equal(1, col('.'))
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
710 call assert_equal(getline(1, 2), ['QWERTZ', 'ASDFGH'])
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
711 call cursor(1,1)
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
712 exe ":norm! \<C-V>3ljd"
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
713 call cursor(1,1)
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
714 norm! $3lP
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
715 call assert_equal(5, col('.'))
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
716 call assert_equal(getline(1, 2), ['TZ QWER', 'GH ASDF'])
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
717 set ve&vim
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
718 bwipe!
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
719 endfunc
136b33ce8216 patch 8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Bram Moolenaar <Bram@vim.org>
parents: 20976
diff changeset
720
23287
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
721 func Test_insert_small_delete()
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
722 new
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
723 call setline(1, ['foo foobar bar'])
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
724 call cursor(1,1)
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
725 exe ":norm! ciw'\<C-R>-'"
23303
9af15022894c patch 8.2.2197: assert arguments order reversed
Bram Moolenaar <Bram@vim.org>
parents: 23287
diff changeset
726 call assert_equal("'foo' foobar bar", getline(1))
23287
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
727 exe ":norm! w.w."
23303
9af15022894c patch 8.2.2197: assert arguments order reversed
Bram Moolenaar <Bram@vim.org>
parents: 23287
diff changeset
728 call assert_equal("'foo' 'foobar' 'bar'", getline(1))
23287
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
729 bwipe!
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
730 endfunc
f2a70fca3485 patch 8.2.2189: cannot repeat a command that uses the small delete register
Bram Moolenaar <Bram@vim.org>
parents: 22502
diff changeset
731
24134
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
732 " Record in insert mode using CTRL-O
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
733 func Test_record_in_insert_mode()
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
734 new
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
735 let @r = ''
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
736 call setline(1, ['foo'])
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
737 call feedkeys("i\<C-O>qrbaz\<C-O>q", 'xt')
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
738 call assert_equal('baz', @r)
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
739 bwipe!
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
740 endfunc
72e9b861bc92 patch 8.2.2608: character input not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23303
diff changeset
741
27410
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
742 func Test_record_in_select_mode()
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
743 new
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
744 call setline(1, 'text')
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
745 sil norm q00
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
746 sil norm q
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
747 call assert_equal('0ext', getline(1))
27418
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
748
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
749 %delete
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
750 let @r = ''
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
751 call setline(1, ['abc', 'abc', 'abc'])
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
752 smap <F2> <Right><Right>,
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
753 call feedkeys("qrgh\<F2>Dk\<Esc>q", 'xt')
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
754 call assert_equal("gh\<F2>Dk\<Esc>", @r)
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
755 norm j0@rj0@@
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
756 call assert_equal([',Dk', ',Dk', ',Dk'], getline(1, 3))
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
757 sunmap <F2>
6ecfb8d99353 patch 8.2.4237: record buffer wrong if character in Select mode was not typed
Bram Moolenaar <Bram@vim.org>
parents: 27410
diff changeset
758
27410
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
759 bwipe!
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
760 endfunc
5d6774c0df4f patch 8.2.4233: crash when recording and using Select mode
Bram Moolenaar <Bram@vim.org>
parents: 26929
diff changeset
761
25808
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
762 " Make sure that y_append is correctly reset
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
763 " and the previous register is working as expected
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
764 func Test_register_y_append_reset()
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
765 new
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
766 call setline(1, ['1',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
767 \ '2 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
768 \ '3',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
769 \ '4',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
770 \ '5 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
771 \ '6',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
772 \ '7',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
773 \ '8 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
774 \ '9',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
775 \ '10 aaaaaaa 4.',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
776 \ '11 Game Dbl-Figures Leaders:',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
777 \ '12 Player Pts FG% 3P% FT% RB AS BL ST TO PF EFF',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
778 \ '13 bbbbbbbbb 12 (50 /0 /67 )/ 7/ 3/ 0/ 2/ 3/ 4/+15',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
779 \ '14 cccccc 12 (57 /67 /100)/ 2/ 1/ 1/ 0/ 1/ 3/+12',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
780 \ '15 ddddddd 10 (63 /0 /0 )/ 1/ 3/ 0/ 3/ 5/ 3/ +9',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
781 \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
782 \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
783 \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
784 \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5'])
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
785 11
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
786 exe "norm! \"a5dd"
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
787 norm! j
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
788 exe "norm! \"bY"
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
789 norm! 2j
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
790 exe "norm! \"BY"
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
791 norm! 4k
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
792 norm! 5dd
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
793 norm! 3k
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
794 " The next put should put the content of the unnamed register, not of
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
795 " register b!
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
796 norm! p
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
797 call assert_equal(['1',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
798 \ '2 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
799 \ '3',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
800 \ '4',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
801 \ '5 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
802 \ '6',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
803 \ '10 aaaaaaa 4.',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
804 \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
805 \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
806 \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
807 \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
808 \ '7',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
809 \ '8 ----------------------------------------------------',
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
810 \ '9'], getline(1,'$'))
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
811 bwipe!
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
812 endfunc
b1440083f0da patch 8.2.3439: deleted lines go to wrong yank register
Bram Moolenaar <Bram@vim.org>
parents: 24695
diff changeset
813
18755
a0be066d0b48 patch 8.1.2367: registers are not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18436
diff changeset
814 " vim: shiftwidth=2 sts=2 expandtab