From 23984dd1f300e09cbc1bc9a80aae3bea32a5bbcc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 17 Dec 2022 10:06:40 +0100 Subject: [PATCH] fix: set correct dir for lazy plugin --- lua/lazy/core/config.lua | 9 ++++++--- lua/lazy/core/plugin.lua | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index df1c042..e4354b3 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -101,6 +101,9 @@ M.to_clean = {} ---@type LazyConfig M.options = {} +---@type string +M.me = nil + ---@param spec LazySpec ---@param opts? LazyConfig function M.setup(spec, opts) @@ -113,10 +116,10 @@ function M.setup(spec, opts) vim.go.packpath = "" end if M.options.performance.rtp.reset then - local me = debug.getinfo(1, "S").source:sub(2) - me = vim.fn.fnamemodify(me, ":p:h:h:h:h") + M.me = debug.getinfo(1, "S").source:sub(2) + M.me = vim.fn.fnamemodify(M.me, ":p:h:h:h:h") vim.opt.rtp = { - me, + M.me, vim.env.VIMRUNTIME, vim.fn.stdpath("config"), vim.fn.stdpath("config") .. "/after", diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 11936d8..ee6558c 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -239,7 +239,7 @@ function M.load() -- add ourselves spec.plugins["lazy.nvim"] = nil - spec:add({ "folke/lazy.nvim", lazy = true, dev = false }) + spec:add({ "folke/lazy.nvim", lazy = true, dir = Config.me }) local existing = Config.plugins Config.plugins = spec.plugins