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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.