From c917d4bccfa315c18fffb05d1258f3825f2914eb Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 16 Sep 2024 13:22:35 +0200 Subject: [PATCH] feat: support lazy-loading rocks-config.nvim bundles (#11) --- lua/rocks-lazy/internal.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/rocks-lazy/internal.lua b/lua/rocks-lazy/internal.lua index 9caf719..017fd6d 100644 --- a/lua/rocks-lazy/internal.lua +++ b/lua/rocks-lazy/internal.lua @@ -18,7 +18,18 @@ function rocks_lazy.load() local rock_spec = user_rocks[plugin.name] if rock_spec then pcall(vim.cmd.packadd, { plugin.name, bang = true }) - rocks_config.configure(rock_spec) + rocks_config.configure( + rock_spec, + ---@param items? rock_name[] + function(items) + vim + .iter(items or {}) + ---@param item rock_name + :each(function(item) + pcall(vim.cmd.packadd, { item, bang = true }) + end) + end + ) else log.warn( ("rocks-lazy: skipping rocks-config hook because %s not found in user rocks."):format(