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.
This commit is contained in:
luukvbaal
2025-05-09 12:17:26 +02:00
committed by GitHub
parent 3121e02ae0
commit 7e787f6a4f
6 changed files with 40 additions and 19 deletions

View File

@@ -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