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)
|
||||
-- M.source_runtime(plugin, "/after/plugin")
|
||||
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
|
||||
M.source_runtime(plugin.dir, "/ftdetect")
|
||||
M.source_runtime(plugin.dir, "ftdetect")
|
||||
end
|
||||
M.source_runtime(plugin.dir, "/after/plugin")
|
||||
M.source_runtime(plugin.dir, "after/plugin")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,9 +10,10 @@ M.build = {
|
|||
end,
|
||||
run = function(self)
|
||||
Loader.load(self.plugin, { task = "build" })
|
||||
-- when installing during startup, add the package
|
||||
-- to make sure all runtime files are loaded
|
||||
Loader.packadd(self.plugin, true)
|
||||
|
||||
-- we need to source its plugin files before startup,
|
||||
-- to make sure the build command has everything available
|
||||
Loader.source_runtime(self.plugin.dir, "plugin")
|
||||
|
||||
local build = self.plugin.build
|
||||
if build then
|
||||
|
|
Loading…
Reference in New Issue