utilyre / barbecue.nvim

Visual Studio Code inspired breadcrumbs plugin for the Neovim editor
MIT License
776 stars 31 forks source link

[BUG]: Vim:E36: Not enough room #61

Closed tsakirist closed 1 year ago

tsakirist commented 1 year ago

Requirements

Expected Behavior

There shouldn't be any error from barbecue, when calling the CodeActionMenu command.

Actual Behavior

Executing CodeActionMenu from nvim-code-action-menu causes an error from barbecue (the first time it works, but afterwards calling CodeActionMenu results in this error)

Screenshot from 2023-02-02 21-31-13

Neovim Version

NVIM v0.9.0-dev-781+gda671b21c

Minimal Configuration

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",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",

  {
      'weilbith/nvim-code-action-menu',
      cmd = 'CodeActionMenu',
      keys = { "<leader>ca", "<Cmd>CodeActionMenu<CR>" },
  },

  {
      "neovim/nvim-lspconfig",
      keys = {
          { "dn", "<Cmd>lua vim.diagnostic.goto_next()<CR>" },
          { "dp", "<Cmd>lua vim.diagnostic.goto_prev()<CR>" },
      },
      config = function()
    require('lspconfig')['rust_analyzer'].setup{}
      end,
  },

  { "williamboman/mason.nvim", opts = {} },

  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "neovim/nvim-lspconfig",
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons",
    },
    config = function()
      require("barbecue").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

Just use CodeActionMenu command when LSP gives you a code-action

utilyre commented 1 year ago

I used to have the exact same issue with dressing on renaming stuff, then I compiled and installed the latest commit of nvim (a26c0ecab610021e6ff6d9d738173a69ecd30fcc in my case) and it stopped giving me the error.

Your repro also seems not to give any errors on the commit I just mentioned. If updating to the latest nvim didn't solve the issue feel free to re-open.

tsakirist commented 1 year ago

I'm on a more recent commit: NVIM v0.9.0-dev-867+gf9826e1df and the error still occurs.

Apparently, it doesn't happen with sumneko-lua LSP, but with the rust-analyzer.

With the rust-analyzer the second time that I use CodeActionMenu command the error occurs.

If you want I can give you the rust file as-well in case you have a rust/cargo setup and you want to debug it.

utilyre commented 1 year ago

I just tested this with rust_analyzer and it didn't break, at least with my version of neovim.

If you want I can give you the rust file as-well in case you have a rust/cargo setup and you want to debug it.

Yes, please post it.

tsakirist commented 1 year ago

Attached in the .zip is the cargo package example.zip

utilyre commented 1 year ago

It turns out that the actual culprit of this bug is nvim core. See neovim/neovim#19464.

mawkler commented 1 year ago

I also have this issue. I'm on version 0.8.2. Disabling barbecue.nvim solves the issue. I'm also using dressing.nvim.

michaeladler commented 1 year ago

I also have this issue (using neovim from today, i.e. 6c39edaa7e5060cedfbbf61e88f4aad20fdff73d). How about wrapping the call using pcall? Looks like that's what lualine did, see https://github.com/nvim-lualine/lualine.nvim/pull/905

linrongbin16 commented 1 year ago

Have the same issue here:

image
linrongbin16 commented 1 year ago

hi @utilyre please release a new tag so we can upgrade newer version.

utilyre commented 1 year ago

Oh yeah, I forgot to mention. You should use the fix/E36 branch until the upstream gets fixed.

utilyre commented 1 year ago

Just wanted to notify that I rebased the fix branch towrads main to get the latest commits. If you're using lazy.nvim you'll be fine updating it, on the other hand I think packer.nvim doesn't deal with push force very well so be aware of that.

BrunoKrugel commented 1 year ago

I am using packer and I am still facing this issue, any fix?

utilyre commented 1 year ago

I am using packer and I am still facing this issue, any fix?

Use fix/E36 branch

cesaralvarod commented 1 year ago

I am using packer and I am still facing this issue, any fix?

Use fix/E36 branch

It works for me thanks!

ispringle commented 1 year ago

Any chance that branch can get rebased again or the fix can be merged into main? Looks like the branch is a bit behind now.

utilyre commented 1 year ago

Seems like the upstream issue is not getting any updates. I'll just merge the fix commit to main at this point.

3rd commented 11 months ago

Been getting this again with barbecue enabled, does it happen for anyone else?

Biggybi commented 4 months ago

Been getting this again with barbecue enabled, does it happen for anyone else?

Yup, but in neovim-nightly only.

Edit: It still comes from barbecue/ui.lua, but later. Does not happen with an empty string.

Tried pcall(), but no dice.