From 7e787f6a4f16ddccfc3017e44f9cb9c9d1615dc3 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Fri, 9 May 2025 12:17:26 +0200 Subject: fix(extui): route interactive messages to more-window (#33885) Problem: Extui does not route messages emitted as a result of a typed command to the "more" window. Command message leading shell messages is missing a kind. Messages not routed to 'cmdheight' area after it was 0. Solution: Route messages that were emitted in the same event loop as an entered command to the "more" window. Also append multiple messages in an already open more-window. Assign it the `shell_cmd` kind. Change message position when 'cmdheight' changes from 0. --- runtime/lua/vim/_extui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_extui.lua') diff --git a/runtime/lua/vim/_extui.lua b/runtime/lua/vim/_extui.lua index 75adcfa7c5..8b3f67076e 100644 --- a/runtime/lua/vim/_extui.lua +++ b/runtime/lua/vim/_extui.lua @@ -82,10 +82,14 @@ function M.enable(opts) local function check_opt(name, value) if name == 'cmdheight' then -- 'cmdheight' set; (un)hide cmdline window and set its height. - ext.cmdheight = value - ext.cfg.msg.pos = ext.cmdheight == 0 and 'box' or ext.cfg.msg.pos - local cfg = { height = math.max(ext.cmdheight, 1), hide = ext.cmdheight == 0 } + local cfg = { height = math.max(value, 1), hide = value == 0 } api.nvim_win_set_config(ext.wins[ext.tab].cmd, cfg) + -- Change message position when 'cmdheight' was or becomes 0. + if value == 0 or ext.cmdheight == 0 then + ext.cfg.msg.pos = value == 0 and 'box' or ext.cmdheight == 0 and 'cmd' + ext.msg.prev_msg = '' + end + ext.cmdheight = value elseif name == 'termguicolors' then -- 'termguicolors' toggled; add or remove border and set 'winblend' for box windows. for _, tab in ipairs(api.nvim_list_tabpages()) do -- cgit