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: The url is overwritten after the merge of the same plugin spec. #1191

Closed
3 tasks done
sunn4room opened this issue Nov 21, 2023 · 6 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@sunn4room
Copy link

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 existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.4

Operating system/version

Arch Linux

Describe the bug

the same as title

Steps To Reproduce

init.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
    "--branch=stable",
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
  spec = {
    {
      "folke/which-key.nvim",
      url = "https://gitee.com/sunn4github/which-key.nvim.git",
      opts = {},
    },
    {
      "folke/which-key.nvim",
      opts = {},
    },
  },
  install = {
    missing = true,
  },
})

lazy.nvim clone the folke/which-key.nvim from https://github.com/folke/which-key.nvim.git

Expected Behavior

expect that lazy.nvim clone the folke/which-key.nvim from https://gitee.com/sunn4github/which-key.nvim.git

Repro

No response

@sunn4room sunn4room added the bug Something isn't working label Nov 21, 2023
@max397574
Copy link
Contributor

tbh I would expect that as a user

@sunn4room
Copy link
Author

I know the order of spec is important to lazy.nvim, but I think some option shouldn't be overwritten, etc url. Because the same plugin spec may locate in different files.

If Not necessary, I would close this issue.

@max397574
Copy link
Contributor

I'd exactly expect url to be one of the ones that get overwritten

@sunn4room
Copy link
Author

There is no problem that overwrite the url, but a real value shouldn't be overwritten by nil.

Anyway, good work about lazy.nvim, this is a great package manager.

@max397574
Copy link
Contributor

real value shouldn't be overwritten by nil

As said before: I'd expect that to be the behavior

@sunn4room
Copy link
Author

Config.spec:parse({ vim.deepcopy(Config.options.spec), { "folke/lazy.nvim" } })

this line force the 'folke/lazy.nvim' clone from 'https://github.com/folke/lazy.nvim'. But in China, it is difficult to access github.

I expect:

  Config.spec:parse({ { "folke/lazy.nvim" }, vim.deepcopy(Config.options.spec) })

THEN I can use my own mirror url to clone 'lazy.nvim'.

@sunn4room sunn4room reopened this Dec 2, 2023
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

No branches or pull requests

2 participants