Patch 8.2.5064
Problem: No test for what 8.1.0052 fixes.
Solution: Add a test. (closes #10531)
Files: src/getchar.c, src/testdir/test_mapping.vim
*** ../vim-8.2.5063/src/getchar.c 2022-06-05 19:01:33.288414978 +0100
--- src/getchar.c 2022-06-06 16:18:34.645297712 +0100
***************
*** 3458,3465 ****
* get a character: 3. from the user - get it
*/
if (typebuf.tb_len == 0)
! // timedout may have been set while waiting for a mapping
! // that has a <Nop> RHS.
timedout = FALSE;
if (advance)
--- 3458,3465 ----
* get a character: 3. from the user - get it
*/
if (typebuf.tb_len == 0)
! // timedout may have been set if a mapping with empty RHS
! // fully matched while longer mappings timed out.
timedout = FALSE;
if (advance)
*** ../vim-8.2.5063/src/testdir/test_mapping.vim 2022-05-09
12:16:14.761073336 +0100
--- src/testdir/test_mapping.vim 2022-06-06 16:18:34.645297712 +0100
***************
*** 1685,1688 ****
--- 1685,1718 ----
nunmap …
endfunc
+ " Testing for mapping after an <Nop> mapping is triggered on timeout.
+ " Test for what patch 8.1.0052 fixes.
+ func Test_map_after_timed_out_nop()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set timeout timeoutlen=400
+ inoremap ab TEST
+ inoremap a <Nop>
+ END
+ call writefile(lines, 'Xtest_map_after_timed_out_nop')
+ let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})
+
+ " Enter Insert mode
+ call term_sendkeys(buf, 'i')
+ " Wait for the "a" mapping to timeout
+ call term_sendkeys(buf, 'a')
+ call term_wait(buf, 500)
+ " Send "a" and wait for a period shorter than 'timeoutlen'
+ call term_sendkeys(buf, 'a')
+ call term_wait(buf, 100)
+ " Send "b", should trigger the "ab" mapping
+ call term_sendkeys(buf, 'b')
+ call WaitForAssert({-> assert_equal("TEST", term_getline(buf, 1))})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_map_after_timed_out_nop')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.5063/src/version.c 2022-06-06 15:38:10.867573392 +0100
--- src/version.c 2022-06-06 16:21:35.209464852 +0100
***************
*** 736,737 ****
--- 736,739 ----
{ /* Add new patch number below this line */
+ /**/
+ 5064,
/**/
--
Q: What's orange and sounds like a parrot?
A: A carrot
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220606152339.28F2D1C291C%40moolenaar.net.