From cd225b69bbf525a698c898e5cd828c78c223704d Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 30 Nov 2023 23:45:34 -0600 Subject: [PATCH] fix(nvim): do not display vim build version if it's not found --- dots/.config/nvim/lua/plugins/configs/alpha.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dots/.config/nvim/lua/plugins/configs/alpha.lua b/dots/.config/nvim/lua/plugins/configs/alpha.lua index ef882d4d..307bd4ac 100644 --- a/dots/.config/nvim/lua/plugins/configs/alpha.lua +++ b/dots/.config/nvim/lua/plugins/configs/alpha.lua @@ -40,11 +40,18 @@ return { type = "text", val = function() local version = vim.version() - return ("─────── v%s.%s.%s+%s ───────"):format( + if version.build ~= vim.NIL then + return ("─────── v%s.%s.%s+%s ───────"):format( + version.major, + version.minor, + version.patch, + version.build + ) + end + return ("─────── v%s.%s.%s ───────"):format( version.major, version.minor, - version.patch, - version.build + version.patch ) end, opts = { position = "center", hl = "@boolean" },