Added performance.rtp.custom_config_dir and dev.extra_paths for nix

compatibility.
Changes to be committed:
modified:   README.md
modified:   lua/lazy/core/config.lua
modified:   lua/lazy/core/plugin.lua
This commit is contained in:
BirdeeHub 2024-01-08 23:18:23 -08:00
commit 68ef7cd3c2
3 changed files with 49 additions and 6 deletions

View file

@ -106,11 +106,31 @@ function Spec:add(plugin, results)
end
-- dev plugins
local devPath = nil
-- check dev.path, and if not check dev.extra_paths
-- if not found, devPath will remain nil
if plugin.dev then
if vim.fn.isdirectory(Config.options.dev.path .. "/" .. plugin.name) == 1 then
devPath = Config.options.dev.path .. "/" .. plugin.name
elseif Config.options.dev.extra_paths
and type(Config.options.dev.extra_paths) == 'table'
then
for _, path in ipairs(Config.options.dev.extra_paths) do
if vim.fn.isdirectory(path .. "/" .. plugin.name) == 1 then
devPath = path .. "/" .. plugin.name
break
end
end
end
end
-- if dev, add dev path as plugin dir, otherwise use root
if
plugin.dev
and (not Config.options.dev.fallback or vim.fn.isdirectory(Config.options.dev.path .. "/" .. plugin.name) == 1)
and (not Config.options.dev.fallback or devPath)
then
dir = Config.options.dev.path .. "/" .. plugin.name
dir = devPath
elseif plugin.dev == false then
-- explicitely select the default path
dir = Config.options.root .. "/" .. plugin.name