Mercurial > vim
comparison src/testdir/test_mapping.vim @ 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 | d772bf077b3f |
children | a27d380b257f |
comparison
equal
deleted
inserted
replaced
11402:3979d8442427 | 11403:74a40efb39ea |
---|---|
169 call assert_equal("bar ", getline(1)) | 169 call assert_equal("bar ", getline(1)) |
170 bwipe! | 170 bwipe! |
171 unabbr foo | 171 unabbr foo |
172 set backspace& | 172 set backspace& |
173 endfunc | 173 endfunc |
174 | |
175 func Test_map_timeout() | |
176 nnoremap aaaa :let got_aaaa = 1<CR> | |
177 nnoremap bb :let got_bb = 1<CR> | |
178 nmap b aaa | |
179 new | |
180 func ExitInsert(timer) | |
181 let g:line = getline(1) | |
182 call feedkeys("\<Esc>", "t") | |
183 endfunc | |
184 set timeout timeoutlen=200 | |
185 call timer_start(300, 'ExitInsert') | |
186 " After the 'b' Vim waits for another character to see if it matches 'bb'. | |
187 " When it times out it is expanded to "aaa", but there is no wait for | |
188 " "aaaa". Can't check that reliably though. | |
189 call feedkeys("b", "xt!") | |
190 call assert_equal("aa", g:line) | |
191 call assert_false(exists('got_aaa')) | |
192 call assert_false(exists('got_bb')) | |
193 | |
194 bwipe! | |
195 nunmap aaaa | |
196 nunmap bb | |
197 nunmap b | |
198 set timeoutlen& | |
199 delfunc ExitInsert | |
200 endfunc |