folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
4.75k stars 154 forks source link

bug: statusline goes away when `cmdheight=0` and `laststatus=3` on latest 0.10 nightly #586

Closed mehalter closed 2 hours ago

mehalter commented 4 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.0-dev-2526+g6525832a8

Operating system/version

Arch Linux

Describe the bug

If I have laststatus=3 and cmdheight=0 the which-key menu makes the statusline go away even after leaving the pop up window. It comes back on the next event such as moving the cursor. This looks to be new on Neovim 0.10 nightly as I cannot replicate on Neovim v0.9. I'm not sure if something has changed on statusline refresh rate or something or if this needs to be reported upstream. Let me know!

Here is a recording on the latest Neovim nightly: https://asciinema.org/a/FlzZqb3TBssFzJrAGmKjahBAu

Also, thanks so much for your contributions to Neovim as a whole and maintaining all of your amazing plugins!

Steps To Reproduce

  1. nvim -u repro.lua, load the minimal configuration
  2. \, press the leader key to bring up the which-key menu
  3. See that the statusline disappears

Expected Behavior

The statusline should remain visible throughout the usage.

Here is a recording on Neovim v0.9 with the correct behavior: https://asciinema.org/a/Str3Mxi17OEyOTD0LqIUJ8bLt

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    "folke/tokyonight.nvim",
    { "folke/which-key.nvim", config = true },
    -- add any other plugins here
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here

vim.opt.cmdheight = 0 -- set cmdheight to 0
vim.opt.laststatus = 3 -- set global statusline
vim.keymap.set("n", "<Leader>q", "<Cmd>q<CR>") -- add a random leader mapping to give us a menu
github-actions[bot] commented 6 days ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.