From a92046e43ff22a04d9ca0d861937463f6e262d38 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 17 Feb 2022 07:18:10 +0800 Subject: vim-patch:8.2.4401: map listing does not clear the rest of the command line Problem: Map listing does not clear the rest of the command line. Solution: Call msg_clear_eos(). (closes vim/vim#5623, closes vim/vim#5962) https://github.com/vim/vim/commit/d288eaad846f0e07e0141226f97d858dcf96cb78 --- src/nvim/getchar.c | 1 + src/nvim/testdir/test_mapping.vim | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 43a4f31478..77e42d7471 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3519,6 +3519,7 @@ static void showmap(mapblock_T *mp, bool local) if (p_verbose > 0) { last_set_msg(mp->m_script_ctx); } + msg_clr_eos(); ui_flush(); // show one line at a time } diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 105f70e6bb..1080a3c85b 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -474,7 +474,6 @@ func Test_expr_map_restore_cursor() END call writefile(lines, 'XtestExprMap') let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10}) - call term_wait(buf) call term_sendkeys(buf, "\") call VerifyScreenDump(buf, 'Test_map_expr_1', {}) @@ -483,6 +482,22 @@ func Test_expr_map_restore_cursor() call delete('XtestExprMap') endfunc +func Test_map_listing() + CheckScreendump + + let lines =<< trim END + nmap a b + END + call writefile(lines, 'XtestMapList') + let buf = RunVimInTerminal('-S XtestMapList', #{rows: 6}) + call term_sendkeys(buf, ": nmap a\") + call VerifyScreenDump(buf, 'Test_map_list_1', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestMapList') +endfunc + func Test_expr_map_error() CheckScreendump @@ -499,7 +514,6 @@ func Test_expr_map_error() END call writefile(lines, 'XtestExprMap') let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10}) - call TermWait(buf) call term_sendkeys(buf, "\") call TermWait(buf) call term_sendkeys(buf, "\") -- cgit