From 7626f431d84fc3a6eb82d0d23d436e3e31e991ce Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 26 Apr 2024 16:21:56 +0200 Subject: fix(ui): update ext_ui widgets when attaching non-remote UI Problem: Updating internalized UI capabilities is postponed until a remote UI attaches. Solution: Always update active UI widgets in ui_refresh(). --- test/functional/lua/ui_event_spec.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 5fe51a2c35..60f8706e2d 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -155,6 +155,14 @@ describe('vim.ui_attach', function() }, }, actual, vim.inspect(actual)) end) + + it('ui_refresh() works without remote UI', function() + screen:detach() + exec_lua('vim.ui_attach(ns, { ext_messages = true }, on_event)') + n.api.nvim_set_option_value('cmdheight', 1, {}) + screen:attach() + eq(1, n.api.nvim_get_option_value('cmdheight', {})) + end) end) describe('vim.ui_attach', function() -- cgit From b8c1b36061f443f82f34f3d4fe7807fc33edefa6 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 27 Apr 2024 01:00:55 +0200 Subject: fix(ui): set 'cmdheight' to zero for all open tabpages Problem: Enabling ext_messages claims to set 'cmdheight' to zero, but only does so for the current tabpage. Solution: Set stored 'cmdheight' value to zero for all tabpages. --- test/functional/lua/ui_event_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 60f8706e2d..ae39172145 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -163,6 +163,13 @@ describe('vim.ui_attach', function() screen:attach() eq(1, n.api.nvim_get_option_value('cmdheight', {})) end) + + it("ui_refresh() sets 'cmdheight' for all open tabpages with ext_messages", function() + exec_lua('vim.cmd.tabnew()') + exec_lua('vim.ui_attach(ns, { ext_messages = true }, on_event)') + exec_lua('vim.cmd.tabnext()') + eq(0, n.api.nvim_get_option_value('cmdheight', {})) + end) end) describe('vim.ui_attach', function() -- cgit