diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-01-22 09:59:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 09:59:02 +0100 |
commit | bdfd023f81ccbb026b22b7f1db4310279d5ae34a (patch) | |
tree | ba7cd3176b62be456048b4c1559b79ce9a559f63 | |
parent | b803bfa5aab1a2f8c74984fbf1176d1ff57d8540 (diff) | |
parent | d3989ea8e8b9b538731cc6ce5b86fa2dba897f09 (diff) | |
download | rneovim-bdfd023f81ccbb026b22b7f1db4310279d5ae34a.tar.gz rneovim-bdfd023f81ccbb026b22b7f1db4310279d5ae34a.tar.bz2 rneovim-bdfd023f81ccbb026b22b7f1db4310279d5ae34a.zip |
Merge pull request #13813 from notomo/fix-nvim-echo-clear
api(echo): should clear cmdline before echo
-rw-r--r-- | src/nvim/api/vim.c | 3 | ||||
-rw-r--r-- | test/functional/api/vim_spec.lua | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 9e2fb6da6f..09895a2119 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1011,8 +1011,9 @@ void nvim_echo(Array chunks, Boolean history, Dictionary opts, Error *err) } no_wait_return++; - bool need_clear = true; msg_start(); + msg_clr_eos(); + bool need_clear = false; for (uint32_t i = 0; i < kv_size(hl_msg); i++) { HlMessageChunk chunk = kv_A(hl_msg, i); msg_multiline_attr((const char *)chunk.text.data, chunk.attr, diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 1d8ffc2087..3ff3efb8c9 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -2021,6 +2021,20 @@ describe('API', function() command('highlight Special guifg=SlateBlue') end) + it('should clear cmdline message before echo', function() + feed(':call nvim_echo([["msg"]], v:false, {})<CR>') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + msg | + ]]} + end) + it('can show highlighted line', function() nvim_async("echo", {{"msg_a"}, {"msg_b", "Statement"}, {"msg_c", "Special"}}, true, {}) screen:expect{grid=[[ |