diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-17 07:18:10 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-02-17 08:45:15 +0800 |
commit | a92046e43ff22a04d9ca0d861937463f6e262d38 (patch) | |
tree | 1b2c9326200a93cd702b42eb4452a0e124076c4b | |
parent | 80a3018a09c1dbfdaa195b25502588dc72c2e186 (diff) | |
download | rneovim-a92046e43ff22a04d9ca0d861937463f6e262d38.tar.gz rneovim-a92046e43ff22a04d9ca0d861937463f6e262d38.tar.bz2 rneovim-a92046e43ff22a04d9ca0d861937463f6e262d38.zip |
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
-rw-r--r-- | src/nvim/getchar.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_mapping.vim | 18 |
2 files changed, 17 insertions, 2 deletions
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, "\<C-B>") 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\<CR>") + 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, "\<F2>") call TermWait(buf) call term_sendkeys(buf, "\<CR>") |