patch 9.1.0351: No test that completing a partial mapping clears 'showcmd' Commit: https://github.com/vim/vim/commit/094c4390bdf3473fab122aa02883e63ce4e66cdb Author: zeertzjq <zeert...@outlook.com> Date: Thu Apr 18 22:09:37 2024 +0200
patch 9.1.0351: No test that completing a partial mapping clears 'showcmd' 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 <zeert...@outlook.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/getchar.c b/src/getchar.c index 783146fe1..4e1c48c52 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 309be7122..c98d5bf33 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -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 diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim index 3fd83cf79..0f46240db 100644 --- a/src/testdir/test_utf8.vim +++ b/src/testdir/test_utf8.vim @@ -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() diff --git a/src/version.c b/src/version.c index 3754073e7..7eb6eab86 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 351, /**/ 350, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1rxY9w-000sbY-5z%40256bit.org.