comparison src/testdir/test_mapping.vim @ 29085:ae39554ad2ee v8.2.5064

patch 8.2.5064: no test for what 8.1.0052 fixes Commit: https://github.com/vim/vim/commit/3760bfddc414e4d3e1c4203db8c22e293cf08d09 Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Jun 6 16:22:46 2022 +0100 patch 8.2.5064: no test for what 8.1.0052 fixes Problem: No test for what 8.1.0052 fixes. Solution: Add a test. (closes https://github.com/vim/vim/issues/10531)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Jun 2022 17:30:03 +0200
parents fea88e555652
children 8a822186f1ab
comparison
equal deleted inserted replaced
29084:e97abb3ba4e2 29085:ae39554ad2ee
1683 nunmap <F2> 1683 nunmap <F2>
1684 unlet g:got_ellipsis 1684 unlet g:got_ellipsis
1685 nunmap … 1685 nunmap …
1686 endfunc 1686 endfunc
1687 1687
1688 " Testing for mapping after an <Nop> mapping is triggered on timeout.
1689 " Test for what patch 8.1.0052 fixes.
1690 func Test_map_after_timed_out_nop()
1691 CheckRunVimInTerminal
1692
1693 let lines =<< trim END
1694 set timeout timeoutlen=400
1695 inoremap ab TEST
1696 inoremap a <Nop>
1697 END
1698 call writefile(lines, 'Xtest_map_after_timed_out_nop')
1699 let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})
1700
1701 " Enter Insert mode
1702 call term_sendkeys(buf, 'i')
1703 " Wait for the "a" mapping to timeout
1704 call term_sendkeys(buf, 'a')
1705 call term_wait(buf, 500)
1706 " Send "a" and wait for a period shorter than 'timeoutlen'
1707 call term_sendkeys(buf, 'a')
1708 call term_wait(buf, 100)
1709 " Send "b", should trigger the "ab" mapping
1710 call term_sendkeys(buf, 'b')
1711 call WaitForAssert({-> assert_equal("TEST", term_getline(buf, 1))})
1712
1713 " clean up
1714 call StopVimInTerminal(buf)
1715 call delete('Xtest_map_after_timed_out_nop')
1716 endfunc
1717
1688 " vim: shiftwidth=2 sts=2 expandtab 1718 " vim: shiftwidth=2 sts=2 expandtab