Skip to content

Commit

Permalink
feat(loader): added explicit support for finding the main module for …
Browse files Browse the repository at this point in the history
…mini.nvim plugins
  • Loading branch information
folke committed May 13, 2023
1 parent e9b3b83 commit dab6cd5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ function M.get_main(plugin)
if plugin.main then
return plugin.main
end
if plugin.name ~= "mini.nvim" and plugin.name:match("^mini%..*$") then
return plugin.name
end
local normname = Util.normname(plugin.name)
---@type string[]
local mods = {}
Expand All @@ -356,6 +359,7 @@ function M.get_main(plugin)
break
end
end

return #mods == 1 and mods[1] or nil
end

Expand Down

2 comments on commit dab6cd5

@luxus
Copy link

@luxus luxus commented on dab6cd5 May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does that mean?

  {
    "echasnovski/mini.colors",
    version = false,
    event = "verylazy",
    config = function(_, opts) require("mini.colors").setup(opts) end,
  },

can i finally skip this config part?

@folke
Copy link
Owner Author

@folke folke commented on dab6cd5 May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luxus yes! Just use opts = {} instead, or config=true (which does the same)

Please sign in to comment.