]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0351: No test that completing a partial mapping clears 'showcmd' v9.1.0351
authorzeertzjq <zeertzjq@outlook.com>
Thu, 18 Apr 2024 20:09:37 +0000 (22:09 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 18 Apr 2024 20:09:37 +0000 (22:09 +0200)
Problem:  No test that completing a partial mapping clears 'showcmd'.
Solution: Complete partial mappings in Test_showcmd_part_map() instead
          of using :echo.  Adjust some comments (zeertzjq).

closes: #14580

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/getchar.c
src/testdir/test_mapping.vim
src/testdir/test_utf8.vim
src/version.c

index 783146fe1a1c7fe87d831e93fb338e711bc2a676..4e1c48c523f4da42d52e2a8f1d98954848e950b0 100644 (file)
@@ -1281,6 +1281,9 @@ del_typebuf(int len, int offset)
        typebuf.tb_change_cnt = 1;
 }
 
+/*
+ * State for adding bytes to a recording or 'showcmd'.
+ */
 typedef struct
 {
     int                prev_c;
index 309be7122691cbd549d04b6422fc1b79dd64b491..c98d5bf332e547192296a962b6732405534b2f9e 100644 (file)
@@ -1811,7 +1811,7 @@ endfunc
 func Test_showcmd_part_map()
   CheckRunVimInTerminal
 
-  let lines =<< trim eval END
+  let lines =<< trim END
     set notimeout showcmd
     nnoremap ,a <Ignore>
     nnoremap ;a <Ignore>
@@ -1831,20 +1831,21 @@ func Test_showcmd_part_map()
   for c in [',', ';', 'À', 'Ë', 'β', 'ω', '…']
     call term_sendkeys(buf, c)
     call WaitForAssert({-> assert_equal(c, trim(term_getline(buf, 6)))})
-    call term_sendkeys(buf, "\<C-C>:echo\<CR>")
-    call WaitForAssert({-> assert_equal('', term_getline(buf, 6))})
+    call term_sendkeys(buf, 'a')
+    call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))})
   endfor
 
   call term_sendkeys(buf, "\<C-W>")
   call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))})
-  call term_sendkeys(buf, "\<C-C>:echo\<CR>")
-  call WaitForAssert({-> assert_equal('', term_getline(buf, 6))})
+  call term_sendkeys(buf, 'a')
+  call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))})
 
-  " Use feedkeys() as terminal buffer cannot forward this
+  " Use feedkeys() as terminal buffer cannot forward unsimplified Ctrl-W.
+  " This is like typing Ctrl-W with modifyOtherKeys enabled.
   call term_sendkeys(buf, ':call feedkeys("\<*C-W>", "m")' .. " | echo\<CR>")
   call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))})
-  call term_sendkeys(buf, "\<C-C>:echo\<CR>")
-  call WaitForAssert({-> assert_equal('', term_getline(buf, 6))})
+  call term_sendkeys(buf, 'a')
+  call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))})
 
   call StopVimInTerminal(buf)
 endfunc
index 3fd83cf79f15d44a944ea1792d08284e0b97059b..0f46240db5aba1fa036781fec050c137c9be6ca2 100644 (file)
@@ -300,7 +300,7 @@ func Test_setcellwidths_dump()
   call StopVimInTerminal(buf)
 endfunc
 
-" When `setcellwidth` is used on characters that are not targets of `ambiwidth`.
+" Test setcellwidths() on characters that are not targets of 'ambiwidth'.
 func Test_setcellwidths_with_non_ambiwidth_character_dump()
   CheckRunVimInTerminal
 
@@ -321,7 +321,6 @@ func Test_setcellwidths_with_non_ambiwidth_character_dump()
   call StopVimInTerminal(buf)
 endfunc
 
-
 " For some reason this test causes Test_customlist_completion() to fail on CI,
 " so run it as the last test.
 func Test_zz_ambiwidth_hl_dump()
index 3754073e7c15855ae6426603e771953785bb9ff3..7eb6eab86f5e70a5ba96ea39a9d1261affc4dff2 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    351,
 /**/
     350,
 /**/