From e121bde8d8eec6611748a038a5216014c9b9a03c Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 27 Dec 2023 19:49:31 +0530 Subject: [PATCH] check for empty/nil mason ensure_installed table #2580 --- lua/plugins/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e081ccf..97d5451 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -133,7 +133,9 @@ local default_plugins = { -- custom nvchad cmd to install all mason binaries listed vim.api.nvim_create_user_command("MasonInstallAll", function() - vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " ")) + if opts.ensure_installed and #opts.ensure_installed > 0 then + vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " ")) + end end, {}) vim.g.mason_binaries_list = opts.ensure_installed