feat(loader): added explicit support for finding the main module for mini.nvim plugins

This commit is contained in:
Folke Lemaitre 2023-05-13 16:09:48 +02:00
parent e9b3b83914
commit dab6cd5080
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 0 deletions

View File

@ -343,6 +343,9 @@ function M.get_main(plugin)
if plugin.main then if plugin.main then
return plugin.main return plugin.main
end end
if plugin.name ~= "mini.nvim" and plugin.name:match("^mini%..*$") then
return plugin.name
end
local normname = Util.normname(plugin.name) local normname = Util.normname(plugin.name)
---@type string[] ---@type string[]
local mods = {} local mods = {}
@ -356,6 +359,7 @@ function M.get_main(plugin)
break break
end end
end end
return #mods == 1 and mods[1] or nil return #mods == 1 and mods[1] or nil
end end