annotate src/testdir/test_registers.vim @ 15995:e7030c0c79cd v8.1.1003

patch 8.1.1003: playing back recorded key sequence mistakes key code commit https://github.com/vim/vim/commit/6edbbd8114320089c0e603e033775d9dd34cb10a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 10 09:41:51 2019 +0100 patch 8.1.1003: playing back recorded key sequence mistakes key code Problem: Playing back recorded key sequence mistakes key code. Solution: Insert a <Nop> after the <Esc>. (closes https://github.com/vim/vim/issues/4068)
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 Mar 2019 09:45:10 +0100
parents 29de75f53b1a
children f4c282082ec8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11682
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 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
3 enew
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 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
5 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
6 " Line-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 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
8 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
9 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
10 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
11 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
12 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
13 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
14 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
15
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 " Block-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 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
18 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
19 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
20 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
21 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
22 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
23 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
24 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
25
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 bwipe!
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 endfunc
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
28
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
29 func Test_display_registers()
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
30 e file1
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
31 e file2
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
32 call setline(1, ['foo', 'bar'])
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
33 /bar
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
34 exe 'norm! y2l"axx'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
35 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
36 call feedkeys(":ls\n", 'xt')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
37
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
38 let a = execute('display')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
39 let b = execute('registers')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
40
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
41 call assert_equal(a, b)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
42 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
43 \ . '"" a\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
44 \ . '"0 ba\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
45 \ . '"a b\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
46 \ . '.*'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
47 \ . '"- a\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
48 \ . '.*'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
49 \ . '": ls\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
50 \ . '"% file2\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
51 \ . '"# file1\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
52 \ . '"/ bar\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
53 \ . '"= 2\*4', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
54
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
55 let a = execute('registers a')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
56 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
57 \ . '"a b', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
58
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
59 let a = execute('registers :')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
60 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
61 \ . '": ls', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
62
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
63 bwipe!
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
64 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
65
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
66 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
67 " 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
68 new
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
69 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
70 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
71 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
72
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
73 " 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
74 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
75 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
76 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
77 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
78
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
79 " 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
80 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
81 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
82 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
83 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
84
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
85 " 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
86 " operators
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
87 " %
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
88 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
89 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
90 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
91 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
92
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
93 " (
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
94 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
95 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
96 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
97 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
98
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
99 " )
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
100 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
101 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
102 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
103 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
104
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
105 " `
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 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
107 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
108 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
109 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
110
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
111 " /
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 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
113 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
114 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
115 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
116
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
117 " ?
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 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
119 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
120 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
121 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
122
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
123 " n
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 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
125 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
126 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
127 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
128
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
129 " N
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 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
131 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
132 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
133 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
134
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
135 " }
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 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
137 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
138 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
139 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
140
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
141 " {
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 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
143 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
144 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
145 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
146
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
147 bwipe!
29de75f53b1a patch 8.1.0999: use register one too often and not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 13855
diff changeset
148 endfunc
15995
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
149
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
150 " 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
151 " 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
152 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
153 new
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
154 let save_F2 = &t_F2
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
155 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
156 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
157 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
158 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
159 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
160 bwipe!
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
161 let t_F2 = save_F2
e7030c0c79cd patch 8.1.1003: playing back recorded key sequence mistakes key code
Bram Moolenaar <Bram@vim.org>
parents: 15987
diff changeset
162 endfunc