fix(ui2): ensure msg window is visible after closing tab

Problem:  After closing a tabpage while the msg window is showing a
          message, it is hidden while the msg window still contains a
          message.
Solution: Unhide the msg window after entering a tabpage and it still
          contains a message.

Co-authored-by: Linykq <yukunlin590@gmail.com>
This commit is contained in:
Luuk van Baal
2026-04-16 02:08:05 +02:00
committed by luukvbaal
parent 6bd2f603aa
commit 607fcfb37a
2 changed files with 23 additions and 1 deletions

View File

@@ -239,8 +239,12 @@ function M.enable(opts)
api.nvim_create_autocmd({ 'VimResized', 'TabEnter' }, {
group = M.augroup,
callback = function()
callback = function(ev)
M.check_targets()
-- After a tabpage was closed unhide the msg window on the current tabpage.
if ev.event == 'TabEnter' and next(M.msg.msg.ids) ~= nil then
api.nvim_win_set_config(M.wins.msg, { hide = false, width = M.msg.msg.width })
end
M.msg.set_pos()
end,
desc = 'Set cmdline and message window dimensions after shell resize or tabpage change.',