folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
13.77k stars 330 forks source link

bug: branch key doesn't work with dev? #383

Closed matthewsia98 closed 1 year ago

matthewsia98 commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.0-dev-588+g99cf11128

Operating system/version

6.1.4-arch1-1

Describe the bug

Fork of lualine has branch trouble-extension. If trouble-extension is checked out everything is fine. If I check out master, lualine complains that the trouble extension implemented in the trouble-extension branch does not exist.

image

Steps To Reproduce

  1. git clone https://github.com/matthewsia98/lualine.nvim.git ~/testing/lualine.nvim
  2. nvim -u repro.lua repro.lua
  3. See lualine error
  4. cd ~/testing/lualine.nvim; git checkout trouble-extension; cd
  5. nvim -u repro.lua repro.lua
  6. No lualine error

Expected Behavior

Use the branch specified

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",
  -- add any other plugins here
  {
      "nvim-lualine/lualine.nvim",
      dev = true,
      branch = "trouble-extension",
      config = function()
          require("lualine").setup({
              extensions = { "trouble" },
          })
      end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
   dev = {
       path = "~/testing",
   },
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
folke commented 1 year ago

If you use a local directory with dir= or with dev=, then all other properties related to the git repository are ignored. Those directories are managed by the user, not lazy