mirror of https://github.com/folke/lazy.nvim.git
fix: source plugin files for plugins that want to run a build script during startup
This commit is contained in:
parent
93d30722a0
commit
3ed24baeb0
|
@ -121,11 +121,11 @@ function M.packadd(plugin)
|
||||||
-- vim.cmd.packadd(plugin.name)
|
-- vim.cmd.packadd(plugin.name)
|
||||||
-- M.source_runtime(plugin, "/after/plugin")
|
-- M.source_runtime(plugin, "/after/plugin")
|
||||||
if M.init_done then
|
if M.init_done then
|
||||||
M.source_runtime(plugin.dir, "/plugin")
|
M.source_runtime(plugin.dir, "plugin")
|
||||||
if vim.g.did_load_filetypes == 1 then
|
if vim.g.did_load_filetypes == 1 then
|
||||||
M.source_runtime(plugin.dir, "/ftdetect")
|
M.source_runtime(plugin.dir, "ftdetect")
|
||||||
end
|
end
|
||||||
M.source_runtime(plugin.dir, "/after/plugin")
|
M.source_runtime(plugin.dir, "after/plugin")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,10 @@ M.build = {
|
||||||
end,
|
end,
|
||||||
run = function(self)
|
run = function(self)
|
||||||
Loader.load(self.plugin, { task = "build" })
|
Loader.load(self.plugin, { task = "build" })
|
||||||
-- when installing during startup, add the package
|
|
||||||
-- to make sure all runtime files are loaded
|
-- we need to source its plugin files before startup,
|
||||||
Loader.packadd(self.plugin, true)
|
-- to make sure the build command has everything available
|
||||||
|
Loader.source_runtime(self.plugin.dir, "plugin")
|
||||||
|
|
||||||
local build = self.plugin.build
|
local build = self.plugin.build
|
||||||
if build then
|
if build then
|
||||||
|
|
Loading…
Reference in New Issue