1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1003
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.1003
Problem: Playing back recorded key sequence mistakes key code.
Solution: Insert a <Nop> after the <Esc>. (closes #4068)
Files: src/getchar.c, src/testdir/test_registers.vim
*** ../vim-8.1.1002/src/getchar.c 2019-03-09 11:23:53.211751929 +0100
--- src/getchar.c 2019-03-09 13:35:15.158641211 +0100
***************
*** 2913,2918 ****
--- 2913,2929 ----
if (gui.in_use && shape_changed)
gui_update_cursor(TRUE, FALSE);
#endif
+ if (timedout && c == ESC)
+ {
+ char_u nop_buf[3];
+
+ // When recording there will be no timeout. Add a <Nop> after the ESC
+ // to avoid that it forms a key code with following characters.
+ nop_buf[0] = K_SPECIAL;
+ nop_buf[1] = KS_EXTRA;
+ nop_buf[2] = KE_NOP;
+ gotchars(nop_buf, 3);
+ }
--vgetc_busy;
*** ../vim-8.1.1002/src/testdir/test_registers.vim 2019-03-08 09:50:43.058308765 +0100
--- src/testdir/test_registers.vim 2019-03-09 13:27:34.746145278 +0100
***************
*** 146,148 ****
--- 146,162 ----
bwipe!
endfunc
+
+ " Check that replaying a typed sequence does not use an Esc and following
+ " characters as an escape sequence.
+ func Test_recording_esc_sequence()
+ new
+ let save_F2 = &t_F2
+ let t_F2 = "\<Esc>OQ"
+ call feedkeys("qqiTest\<Esc>", "xt")
+ call feedkeys("OQuirk\<Esc>q", "xt")
+ call feedkeys("Go\<Esc>@q", "xt")
+ call assert_equal(['Quirk', 'Test', 'Quirk', 'Test'], getline(1, 4))
+ bwipe!
+ let t_F2 = save_F2
+ endfunc
*** ../vim-8.1.1002/src/version.c 2019-03-09 12:32:50.673562149 +0100
--- src/version.c 2019-03-10 08:30:11.025545447 +0100
***************
*** 781,782 ****
--- 781,784 ----
{ /* Add new patch number below this line */
+ /**/
+ 1003,
/**/
--
hundred-and-one symptoms of being an internet addict:
43. You tell the kids they can't use the computer because "Daddy's got work to
do" and you don't even have a job.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|