From 74d8b8e4e180c40d2ade750940f3c64761fb7930 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 24 Dec 2022 11:15:57 +0100 Subject: [PATCH] fix: plugin list can be string[]. Fixes #145 --- lua/lazy/manage/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazy/manage/init.lua b/lua/lazy/manage/init.lua index a87d982..aefd6ae 100644 --- a/lua/lazy/manage/init.lua +++ b/lua/lazy/manage/init.lua @@ -9,7 +9,7 @@ local M = {} ---@field clear? boolean ---@field show? boolean ---@field mode? string ----@field plugins? LazyPlugin[] +---@field plugins? (LazyPlugin|string)[] ---@field concurrency? number ---@param ropts RunnerOpts @@ -18,6 +18,10 @@ function M.run(ropts, opts) opts = opts or {} if opts.plugins then + ---@param plugin string|LazyPlugin + opts.plugins = vim.tbl_map(function(plugin) + return type(plugin) == "string" and Config.plugins[plugin] or plugin + end, vim.tbl_values(opts.plugins)) ropts.plugins = opts.plugins end