To: vim_dev@googlegroups.com Subject: Patch 8.2.5064 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 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 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 + 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///