Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/rubikscube/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ local function open_help(session)
border = "rounded",
style = "minimal",
focusable = false,
-- Above the cube float: among equal-zindex floats Neovim raises the
-- *focused* one, which would hide this non-focusable overlay behind
-- the (focused) cube window.
zindex = 60,
})
session.help_buf = buf
session.help_win = win
Expand Down
10 changes: 10 additions & 0 deletions tests/test_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ T.test("help handler opens then toggles closed", function()
ui.make_quit_handler(s)()
end)

T.test("help float stacks above the (focused) cube float", function()
-- Equal zindex would render the focused cube float over this non-focusable
-- overlay, hiding it. Regression for the covered-help bug.
local s = ui.open()
ui.make_help_handler(s)()
local zindex = vim.api.nvim_win_get_config(s.help_win).zindex
T.truthy(zindex and zindex > 50, "help zindex above default (got " .. tostring(zindex) .. ")")
ui.make_quit_handler(s)()
end)

T.test("repaint after move updates buffer (smoke test)", function()
local s = ui.open()
local before = vim.api.nvim_buf_get_lines(s.buf, 0, -1, false)
Expand Down
Loading