]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.0.0586: no test for mapping timing out v8.0.0586
authorBram Moolenaar <Bram@vim.org>
Sun, 23 Apr 2017 16:49:36 +0000 (18:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 23 Apr 2017 16:49:36 +0000 (18:49 +0200)
Problem:    No test for mapping timing out.
Solution:   Add a test.

src/testdir/test_mapping.vim
src/version.c

index ab02a87e10cda8c143ff07619dbd61c37b178eaa..5026d6b2bb2d7718f71f74957f044d1e298d23ee 100644 (file)
@@ -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
index 47dd973b0154031db165de8d136b8fed2b05869f..3e683e80fffed6b54852416d3fbed162b0e6e921 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    586,
 /**/
     585,
 /**/