From 1a0416c077f57339800e29fbe71b735d1eaba6b1 Mon Sep 17 00:00:00 2001 From: Andrew Chadwick <61299+achadwick@users.noreply.github.com> Date: Wed, 13 May 2026 17:13:32 +0100 Subject: [PATCH] fix: add an extra check for defined fg (#19) Avoid trying to format a nil value. This situation occurs when lazy.nvim displays UI at startup to install a plugin, and could potentially break in other situations where not everything's fully defined. --- plugin/bg.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/bg.lua b/plugin/bg.lua index fb3ff3d..8eec4e4 100644 --- a/plugin/bg.lua +++ b/plugin/bg.lua @@ -22,7 +22,7 @@ local update = function() local normal = vim.api.nvim_get_hl(0, { name = "Normal", link = false, create = false }) local bg = normal.bg local fg = normal.fg - if bg == nil then + if bg == nil or fg == nil then return reset() end