noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: Error `Invalid window id: ...` when I close the LSP hover window with the new `fclose!` command.

Open mawkler opened this issue 1 year ago • 8 comments

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

  1. echo 'local foo = "bar"' > test.lua
  2. nvim -u path/to/config/above test.lua
  3. Press K with the cursor on foo to do LSP hover on it
  4. :fclose!
  5. (make sure not to move the cursor until the next step)
  6. Press K
  7. 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

mawkler avatar Jun 03 '24 12:06 mawkler

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.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

Please don't close this issue Mr. Bot

mawkler avatar Jul 06 '24 07:07 mawkler

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.

github-actions[bot] avatar Aug 07 '24 01:08 github-actions[bot]

The bug isn't fixed. Please don't close this issue Mr. Bot

mawkler avatar Aug 07 '24 05:08 mawkler

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.

github-actions[bot] avatar Sep 07 '24 01:09 github-actions[bot]

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.

mawkler avatar Sep 09 '24 07:09 mawkler

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.

github-actions[bot] avatar Oct 10 '24 02:10 github-actions[bot]

Bruh

mawkler avatar Oct 10 '24 06:10 mawkler

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.

github-actions[bot] avatar Nov 10 '24 02:11 github-actions[bot]

My brother in christ please stop this suffering

mawkler avatar Nov 10 '24 07:11 mawkler

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.

github-actions[bot] avatar Dec 11 '24 02:12 github-actions[bot]

Potato

mawkler avatar Dec 11 '24 06:12 mawkler

Why not provide a PR instead?

folke avatar Dec 11 '24 09:12 folke

I could give it a try. Do you have any idea what the issue might be and/or where I should start looking?

mawkler avatar Dec 23 '24 13:12 mawkler

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.

github-actions[bot] avatar Jan 23 '25 02:01 github-actions[bot]

The bug is still there, Mr. Actions.

mawkler avatar Jan 23 '25 09:01 mawkler

Create a PR ?

folke avatar Jan 23 '25 09:01 folke

@folke Sure I could try, do you know what the problem might be or where I should start looking?

mawkler avatar Jan 23 '25 09:01 mawkler

Who knows

folke avatar Jan 23 '25 09:01 folke

Ok, that makes it quite difficult for me to provide a PR, because I have no clue why the window ID is invalid 🤔

mawkler avatar Jan 23 '25 10:01 mawkler

I also have this issue.

maddie-m avatar Jan 30 '25 03:01 maddie-m

Thank you very much @folke for fixing this issue!

mawkler avatar Jan 30 '25 09:01 mawkler