diff options
author | max397574 <[email protected]> | 2022-01-06 18:13:43 +0100 |
---|---|---|
committer | max397574 <[email protected]> | 2022-01-06 18:13:43 +0100 |
commit | ff8569624a53580380535034233e4406dc4e0da9 (patch) | |
tree | 873599d6e857539bcd001a2961c88ff0b397b880 /lua/startup/functions.lua | |
parent | 46d0a1fea5b59ef31febbf61b4a708e7bb4c3a60 (diff) |
fix(functions): check if plugins table exists
Diffstat (limited to 'lua/startup/functions.lua')
-rw-r--r-- | lua/startup/functions.lua | 16 |
1 files changed, 10 insertions, 6 deletions
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 |