Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Lazy Fails to Detect Different Plugins If They Have The Same Repository Name #337

Closed
3 tasks done
unrealapex opened this issue Jan 7, 2023 · 6 comments · Fixed by #341
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@unrealapex
Copy link
Contributor

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.8.2

Operating system/version

Windows 10 + WSL

Describe the bug

When two or more plugins with the same repository name are present, Lazy does not recognize all of them.

This issue is related to #331.

Steps To Reproduce

  1. Have two or more plugins with the same repository name, in my example kien/rainbow_parentheses.vim and junegunn/rainbow_parentheses.vim(Junegunn's is a fork of Kien's).
  2. Try installing them both
  3. See that only one installs

Expected Behavior

Lazy would identify that the plugins are different and handle them accordingly.

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",
  "junegunn/rainbow_parentheses.vim",
  -- lazy will only install this plugin, not both of them
  -- while doing :checkhealth lazy, it appears the last plugin overrides any previous plugins with the same name
  "kien/rainbow_parentheses.vim"
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@unrealapex unrealapex added the bug Something isn't working label Jan 7, 2023
@folke
Copy link
Owner

folke commented Jan 7, 2023

Duplicate of #331

@folke folke marked this as a duplicate of #331 Jan 7, 2023
@folke folke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2023
@folke folke reopened this Jan 7, 2023
@folke folke closed this as completed in c313249 Jan 7, 2023
@folke
Copy link
Owner

folke commented Jan 7, 2023

Just added an error message when two specs have the same name and a differen url.

It was already shown in :checkhealth lazy, but now you'll also get an explicit error.

To solve this, just use name=... to name one of the two differently

@WillEhrendreich
Copy link

I think this is relevant here but if you want me to open up a separate issue I can do that too..

If you have a fork of a plugin, then switch from the main to the fork, Lazy doesn't correctly see that there are updates that exist.

I discovered this as I am rewriting ionide-vim all in lua, because I'm a masochist, evidently. (actually it's an attempt to understand how any of this works, while hopefully making meaningful contribution to the fsharp community.. but.. also.. it hurts, coach... )

When I switch from pointing from ionide/ionide-vim to willehrendreich/ionide-vim, lazy doesn't see that it needs updates. The update checking claims it's perfectly fine.

image

As a work around, I can of course delete the directory that stores it, but I thought it might be helpful to point it out to you that this happens.

Thanks for all your awesome work, @folke, you make some great stuff.

@max397574
Copy link
Contributor

actually there is an issue for this somewhere
which was closed
because you can just reinstall with keybindings

@unrealapex
Copy link
Contributor Author

#331, I referenced that issue in mine.

@folke
Copy link
Owner

folke commented Jan 19, 2023

@WillEhrendreich when the origin url changes, lazy does detect that. Doing a check would show an error that you need to run update to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants