fix(extui): cmdline visibility, cmdheight cursor position (#33774)

Problem:  The cmdline popupmenu is hidden behind extui windows.
          'showmode' message is drawn over the cmdline.
          Changing the 'cmdheight' to accommodate space for the text in
          the cmdline may change the current cursor position.
Solution: Ensure kZIndexMessages < zindex < kZIndexCmdlinePopupMenu.
          Clear the 'showmode' message when the cmdline level is negative.
          Temporarily set 'splitkeep' = "screen" when changing the 'cmdheight'.
This commit is contained in:
luukvbaal
2025-05-02 19:46:30 +02:00
committed by GitHub
parent c916bdf329
commit 39a5b7f239
3 changed files with 13 additions and 8 deletions

View File

@@ -29,7 +29,6 @@ local wincfg = { -- Default cfg for nvim_open_win().
width = 10000,
height = 1,
noautocmd = true,
zindex = 300,
}
--- Ensure the various buffers and windows have not been deleted.
@@ -63,6 +62,8 @@ function M.tab_check_wins()
hide = type ~= 'cmd' or M.cmdheight == 0 or nil,
title = type == 'more' and 'Messages' or nil,
border = type == 'box' and not o.termguicolors and 'single' or border or 'none',
-- kZIndexMessages < zindex < kZIndexCmdlinePopupMenu (grid_defs.h), 'more' below others.
zindex = 200 - (type == 'more' and 1 or 0),
_cmdline_offset = type == 'cmd' and 0 or nil,
})
M.wins[M.tab][type] = api.nvim_open_win(M.bufs[type], false, cfg)