fix(plugins): ensure defaults for add

This commit is contained in:
Matt Leong 2021-10-25 20:15:00 -07:00
parent b377cf8c09
commit f7ca86256a
2 changed files with 9 additions and 2 deletions

View file

@ -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
]]

View file

@ -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