From 094c4390bdf3473fab122aa02883e63ce4e66cdb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 18 Apr 2024 22:09:37 +0200 Subject: 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 Signed-off-by: Christian Brabandt --- src/testdir/test_mapping.vim | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/testdir/test_mapping.vim') diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 309be71226..c98d5bf332 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 nnoremap ;a @@ -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, "\:echo\") - 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, "\") call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))}) - call term_sendkeys(buf, "\:echo\") - 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\") call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))}) - call term_sendkeys(buf, "\:echo\") - 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 -- cgit v1.2.3