diff options
author | devbhan singh <devbhan25@gmail.com> | 2021-01-20 14:55:52 +0530 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-05-21 23:22:23 +0200 |
commit | 646e1c3a3adf89928959c3a0d6a1bd7c55ca932f (patch) | |
tree | b160c396d91392929ee4cd4b51aa42ec50e5d1f2 /test/functional/ui/screen.lua | |
parent | 1f1a65a9e4c602cd80458b213c28eadbdb5b1de1 (diff) | |
download | rneovim-646e1c3a3adf89928959c3a0d6a1bd7c55ca932f.tar.gz rneovim-646e1c3a3adf89928959c3a0d6a1bd7c55ca932f.tar.bz2 rneovim-646e1c3a3adf89928959c3a0d6a1bd7c55ca932f.zip |
feat(ui): clear message history explicitly with msg_history_clear event
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 06daabad1a..d6de1fa8a9 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -242,7 +242,7 @@ end -- canonical order of ext keys, used to generate asserts local ext_keys = { 'popupmenu', 'cmdline', 'cmdline_block', 'wildmenu_items', 'wildmenu_pos', - 'messages', 'showmode', 'showcmd', 'ruler', 'float_pos', 'win_viewport' + 'messages', 'msg_history', 'showmode', 'showcmd', 'ruler', 'float_pos', 'win_viewport' } -- Asserts that the screen state eventually matches an expected state. @@ -1083,6 +1083,10 @@ function Screen:_handle_msg_history_show(entries) self.msg_history = entries end +function Screen:_handle_msg_history_clear() + self.msg_history = {} +end + function Screen:_clear_block(grid, top, bot, left, right) for i = top, bot do self:_clear_row_section(grid, i, left, right) @@ -1171,7 +1175,7 @@ function Screen:_extstate_repr(attr_state) local msg_history = {} for i, entry in ipairs(self.msg_history) do - messages[i] = {kind=entry[1], content=self:_chunks_repr(entry[2], attr_state)} + msg_history[i] = {kind=entry[1], content=self:_chunks_repr(entry[2], attr_state)} end local win_viewport = (next(self.win_viewport) and self.win_viewport) or nil |