bug: Error `Invalid window id: ...` when I close the LSP hover window with the new `fclose!` command.
Did you check docs and existing issues?
- [X] I have read all the noice.nvim docs
- [X] I have searched the existing issues of noice.nvim
- [X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
v0.11.0-dev-164+g3a1515bfe
Operating system/version
Arch (btw) Linux
Describe the bug
I get the error Invalid window id: ... when I open the LSP hover window twice, after closing it the first time with :fclose!.
Steps To Reproduce
echo 'local foo = "bar"' > test.luanvim -u path/to/config/above test.lua- Press
Kwith the cursor onfooto do LSP hover on it :fclose!- (make sure not to move the cursor until the next step)
- Press
K - Error:
noice.nvim ERROR ...r/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:168: Invalid window id: 1002
Note that if I move the cursor back and forth before pressing K the second time, I get no error.
Expected Behavior
No error message after pressing K the second time
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/noice.nvim",
dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
opts = {},
},
{
'neovim/nvim-lspconfig',
dependencies = {
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
require('mason').setup()
local servers = {}
require('mason-tool-installer').setup { ensure_installed = { 'lua_ls' } }
require('mason-lspconfig').setup {
handlers = {
function(server_name)
local server = servers[server_name] or {}
require('lspconfig')[server_name].setup(server)
end,
},
}
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
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.
Please don't close this issue Mr. Bot
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.
The bug isn't fixed. Please don't close this issue Mr. Bot
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.
Mr. Actions, we've already been through this. Please for the love of all that is holy don't close this issue because the bug is still there.
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.
Bruh
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.
My brother in christ please stop this suffering
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.
Potato
Why not provide a PR instead?
I could give it a try. Do you have any idea what the issue might be and/or where I should start looking?
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.
The bug is still there, Mr. Actions.
Create a PR ?
@folke Sure I could try, do you know what the problem might be or where I should start looking?
Who knows
Ok, that makes it quite difficult for me to provide a PR, because I have no clue why the window ID is invalid 🤔
I also have this issue.
Thank you very much @folke for fixing this issue!