Mercurial > vim
changeset 11403:74a40efb39ea v8.0.0586
patch 8.0.0586: no test for mapping timing out
commit https://github.com/vim/vim/commit/b7637c44c26b057d1f3721d932bbab06d9f74393
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 23 18:49:36 2017 +0200
patch 8.0.0586: no test for mapping timing out
Problem: No test for mapping timing out.
Solution: Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 23 Apr 2017 19:00:03 +0200 |
parents | 3979d8442427 |
children | 189a1ed1ed48 |
files | src/testdir/test_mapping.vim src/version.c |
diffstat | 2 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -171,3 +171,30 @@ func Test_abbr_after_line_join() unabbr foo set backspace& endfunc + +func Test_map_timeout() + nnoremap aaaa :let got_aaaa = 1<CR> + nnoremap bb :let got_bb = 1<CR> + nmap b aaa + new + func ExitInsert(timer) + let g:line = getline(1) + call feedkeys("\<Esc>", "t") + endfunc + set timeout timeoutlen=200 + call timer_start(300, 'ExitInsert') + " After the 'b' Vim waits for another character to see if it matches 'bb'. + " When it times out it is expanded to "aaa", but there is no wait for + " "aaaa". Can't check that reliably though. + call feedkeys("b", "xt!") + call assert_equal("aa", g:line) + call assert_false(exists('got_aaa')) + call assert_false(exists('got_bb')) + + bwipe! + nunmap aaaa + nunmap bb + nunmap b + set timeoutlen& + delfunc ExitInsert +endfunc