From f7ca86256a988c4e0ac5e3e63cceb7c55020e6c1 Mon Sep 17 00:00:00 2001 From: Matt Leong Date: Mon, 25 Oct 2021 20:15:00 -0700 Subject: [PATCH] fix(plugins): ensure defaults for add --- lua/cosmic/config/plugins.lua | 5 ++++- lua/cosmic/pluginsInit.lua | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/cosmic/config/plugins.lua b/lua/cosmic/config/plugins.lua index 082ef26..215ab9c 100644 --- a/lua/cosmic/config/plugins.lua +++ b/lua/cosmic/config/plugins.lua @@ -1,6 +1,8 @@ -- Add additional plugins as well as disable some core plugins ---[[ local plugins = { +--[[ + +local plugins = { add = { 'ggandor/lightspeed.nvim', { @@ -22,4 +24,5 @@ } return plugins + ]] diff --git a/lua/cosmic/pluginsInit.lua b/lua/cosmic/pluginsInit.lua index d1c02b8..41434eb 100644 --- a/lua/cosmic/pluginsInit.lua +++ b/lua/cosmic/pluginsInit.lua @@ -15,10 +15,14 @@ end if user_plugins == true then user_plugins = { + add = {}, disable = {}, } end +if not vim.tbl_islist(user_plugins.add) then + user_plugins.add = {} +end if not vim.tbl_islist(user_plugins.disable) then user_plugins.disable = {} end @@ -200,7 +204,7 @@ return packer.startup(function() disable = vim.tbl_contains(user_plugins.disable, 'colorizer'), }) - if user_plugins.add and not vim.tbl_isempty(user_plugins) then + if user_plugins.add and not vim.tbl_isempty(user_plugins.add) then for _, plugin in pairs(user_plugins.add) do use(plugin) end