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

bug: Specifying `name` spec in `lazy.nvim` plugin configuration file causes it to clone the repo twice.

Open johnsmith0x3f opened this issue 1 year ago • 5 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)

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1716656478

Operating system/version

Arch Linux with Kernel 6.9.7

Describe the bug

After adding name = "Noise" in the installation file and running NeoVim, lazy.nvim clones the repo twice and stores it into two directories named "Noice" and "noice.nvim". Both of the plugins are loaded, while configurations like event = 'VeryLazy' are applied only to the former one.

Steps To Reproduce

  1. Simply add name = "Noise" to the configuration file.

Expected Behavior

lazy.nvim loads and only loads the plugin once with the name shown as "Noice".

Repro

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 = {
  "folke/tokyonight.nvim",
  {
    name = "Noice", "folke/noice.nvim",
    event = "VeryLazy",
    dependencies = {
      "MunifTanjim/nui.nvim",
      "rcarriga/nvim-notify",
    },
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])
require("noice").setup()

johnsmith0x3f avatar Jul 08 '24 12:07 johnsmith0x3f

It will clone it again and the other one will be flagged for cleanup. That's how it's supposed to work

folke avatar Jul 08 '24 13:07 folke

Sorry for the late reply. It seems that it didn't work like it's supposed to. My other plugins like the tokyonight colorscheme worked as desired, yet I have a noice.nvim placed under Loaded in the :Lazy list. Is there any other information I can provide?

johnsmith0x3f avatar Jul 09 '24 04:07 johnsmith0x3f

Moved to lazy. Will check in the coming days. Low prio

folke avatar Jul 09 '24 10:07 folke

Thanks!

johnsmith0x3f avatar Jul 09 '24 15:07 johnsmith0x3f

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 09 '24 01:08 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

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