From 394f69a25dc32c5b101ba2d34ac6376b0c75b2a2 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 20 Dec 2024 21:11:38 +0100 Subject: feat(ui): additional arguments for cmdline_show/hide events Problem: Unable to tell what highlight the prompt part of a cmdline_show event should have, and whether cmdline_hide was emitted after aborting. Solution: Add additional arguments hl_id to cmdline_show, and abort to cmdline_hide. --- test/functional/lua/ui_event_spec.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/functional/lua/ui_event_spec.lua') diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 25cc46e260..2922fb5414 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -261,6 +261,7 @@ describe('vim.ui_attach', function() lled in a fast event context | {1:~ }| ]], + cmdline = { { abort = false } }, messages = { { content = { { 'E122: Function Foo already exists, add ! to replace it', 9, 6 } }, @@ -278,6 +279,7 @@ describe('vim.ui_attach', function() Y)? | {1:~ }| ]], + cmdline = { { abort = false } }, messages = { { content = { { 'replace with Replacement (y/n/a/q/l/^E/^Y)?', 6, 18 } }, @@ -294,6 +296,7 @@ describe('vim.ui_attach', function() e mouse (q or empty cancels): | {1:^~ }| ]], + cmdline = { { abort = false } }, messages = { { content = { { 'Select:\nOne\nTwo\n' } }, @@ -359,6 +362,7 @@ describe('vim.ui_attach', function() {9:back from ns: 1.} | {100:Press ENTER or type command to continue}^ | ]], + cmdline = { { abort = false } }, }) feed('') -- Also when scheduled -- cgit From a10636fbe7bb4dba45c42c64548e5e32fe8f8d12 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sun, 22 Dec 2024 13:21:57 +0100 Subject: feat(ui): specify whether msg_show event is added to history Pass along whether message in msg_show event is added to the internal :messages history. --- test/functional/lua/ui_event_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional/lua/ui_event_spec.lua') diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 2922fb5414..7e890e8ae0 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -265,6 +265,7 @@ describe('vim.ui_attach', function() messages = { { content = { { 'E122: Function Foo already exists, add ! to replace it', 9, 6 } }, + history = true, kind = 'emsg', }, }, @@ -283,6 +284,7 @@ describe('vim.ui_attach', function() messages = { { content = { { 'replace with Replacement (y/n/a/q/l/^E/^Y)?', 6, 18 } }, + history = true, kind = 'confirm_sub', }, }, @@ -300,10 +302,12 @@ describe('vim.ui_attach', function() messages = { { content = { { 'Select:\nOne\nTwo\n' } }, + history = false, kind = 'list_cmd', }, { content = { { 'Type number and or click with the mouse (q or empty cancels): ' } }, + history = false, kind = 'number_prompt', }, }, @@ -382,6 +386,7 @@ describe('vim.ui_attach', function() 6, }, }, + history = true, kind = 'lua_error', }, { @@ -392,10 +397,12 @@ describe('vim.ui_attach', function() 6, }, }, + history = true, kind = 'lua_error', }, { content = { { 'Press ENTER or type command to continue', 100, 18 } }, + history = false, kind = 'return_prompt', }, }, -- cgit