summaryrefslogtreecommitdiff
path: root/lua/core/dashboard.lua
diff options
context:
space:
mode:
authorchaesngmin <[email protected]>2021-09-17 05:14:31 -0700
committerGitHub <[email protected]>2021-09-17 05:14:31 -0700
commit390f277b702fe7877f0d5fabbece230528b58cb1 (patch)
tree6ee0fd6e116aa8f94c8ba7dffea297f12d86d5fd /lua/core/dashboard.lua
parent254ab2102b5f8f6187321a545998ead4c3abd27a (diff)
fix(dashboard): hide version when no tag found (#1572)
Diffstat (limited to 'lua/core/dashboard.lua')
-rw-r--r--lua/core/dashboard.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua
index 44c4e38c..505350cb 100644
--- a/lua/core/dashboard.lua
+++ b/lua/core/dashboard.lua
@@ -73,14 +73,19 @@ M.setup = function()
local lvim_version = get_version "short"
local num_plugins_loaded = #vim.fn.globpath(get_runtime_dir() .. "/site/pack/packer/start", "*", 0, 1)
- local text = require "interface.text"
- vim.g.dashboard_custom_footer = text.align_center({ width = 0 }, {
+ local footer = {
"LunarVim loaded " .. num_plugins_loaded .. " plugins ",
"",
- "v" .. lvim_version,
- "",
lvim_site,
- }, 0.49) -- Use 0.49 as  counts for 2 characters
+ }
+
+ if lvim_version then
+ table.insert(footer, 2, "")
+ table.insert(footer, 3, "v" .. lvim_version)
+ end
+
+ local text = require "interface.text"
+ vim.g.dashboard_custom_footer = text.align_center({ width = 0 }, footer, 0.49) -- Use 0.49 as  counts for 2 characters
require("core.autocmds").define_augroups {
_dashboard = {