From ff8569624a53580380535034233e4406dc4e0da9 Mon Sep 17 00:00:00 2001 From: max397574 Date: Thu, 6 Jan 2022 18:13:43 +0100 Subject: fix(functions): check if plugins table exists --- lua/startup/functions.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lua/startup/functions.lua') diff --git a/lua/startup/functions.lua b/lua/startup/functions.lua index ef9816e..63c26df 100644 --- a/lua/startup/functions.lua +++ b/lua/startup/functions.lua @@ -17,12 +17,16 @@ end ---Returns a string with the number of loaded Packer Plugins ---@return string: String with info about the number of loaded plugins function functions.packer_plugins() - return { - string.format( - "Total plugins (packer.nvim): %d", - vim.tbl_count(packer_plugins) - ), - } + if packer_plugins then + return { + string.format( + "Total plugins (packer.nvim): %d", + vim.tbl_count(packer_plugins) + ), + } + else + return "" + end end ---Returns the current date and time -- cgit v1.2.3