Skip to content

Commit b7637c4

Browse files
committed
patch 8.0.0586: no test for mapping timing out
Problem: No test for mapping timing out. Solution: Add a test.
1 parent 86e5792 commit b7637c4

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/testdir/test_mapping.vim

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,30 @@ func Test_abbr_after_line_join()
171171
unabbr foo
172172
set backspace&
173173
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

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
586,
767769
/**/
768770
585,
769771
/**/

0 commit comments

Comments
 (0)