mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-27 19:24:13 +00:00
feat: add option to use lua patterns for dev patterns
This commit is contained in:
parent
4496b4cad6
commit
90d12dad08
3 changed files with 7 additions and 1 deletions
|
@ -667,6 +667,7 @@ will be added to the plugin’s spec.
|
|||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
plain = true, -- true uses plain string matching for the patterns, false uses Lua patterns
|
||||
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||
},
|
||||
install = {
|
||||
|
|
|
@ -71,6 +71,7 @@ M.defaults = {
|
|||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
plain = true, -- true uses plain string matching for the patterns, false uses Lua patterns
|
||||
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||
},
|
||||
install = {
|
||||
|
|
|
@ -215,8 +215,12 @@ function M:_rebuild(name)
|
|||
plugin.dir = Util.norm(plugin.dir)
|
||||
else
|
||||
if plugin.dev == nil and plugin.url then
|
||||
local plain = Config.options.dev.plain
|
||||
if plain == nil then
|
||||
plain = true -- Default to true if not set
|
||||
end
|
||||
for _, pattern in ipairs(Config.options.dev.patterns) do
|
||||
if plugin.url:find(pattern, 1, true) then
|
||||
if plugin.url:find(pattern, 1, plain) then
|
||||
plugin.dev = true
|
||||
break
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue