aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/ui_event_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 17:57:01 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 17:57:01 +0000
commit9837de570c5972f98e74848edc97c297a13136ea (patch)
treecc948611912d116a3f98a744e690d3d7b6e2f59a /test/functional/lua/ui_event_spec.lua
parentc367400b73d207833d51e09d663f969ffab37531 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-9837de570c5972f98e74848edc97c297a13136ea.tar.gz
rneovim-9837de570c5972f98e74848edc97c297a13136ea.tar.bz2
rneovim-9837de570c5972f98e74848edc97c297a13136ea.zip
Merge remote-tracking branch 'upstream/master' into colorcolchar
Diffstat (limited to 'test/functional/lua/ui_event_spec.lua')
-rw-r--r--test/functional/lua/ui_event_spec.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua
index 57ffcf7b4e..6481da900e 100644
--- a/test/functional/lua/ui_event_spec.lua
+++ b/test/functional/lua/ui_event_spec.lua
@@ -117,4 +117,31 @@ describe('vim.ui_attach', function()
})
eq(0, helpers.eval('v:shell_error'))
end)
+
+ it('can receive accurate message kinds even if they are history', function()
+ exec_lua([[
+ vim.cmd.echomsg("'message1'")
+ print('message2')
+ vim.ui_attach(ns, { ext_messages = true }, on_event)
+ vim.cmd.echomsg("'message3'")
+ ]])
+ feed(':messages<cr>')
+ feed('<cr>')
+
+ local actual = exec_lua([[
+ return vim.tbl_filter(function (event)
+ return event[1] == "msg_history_show"
+ end, events)
+ ]])
+ eq({
+ {
+ 'msg_history_show',
+ {
+ { 'echomsg', { { 0, 'message1' } } },
+ { '', { { 0, 'message2' } } },
+ { 'echomsg', { { 0, 'message3' } } },
+ },
+ },
+ }, actual, inspect(actual))
+ end)
end)