fix(image): fix disappearing images when changing colorscheme

This commit is contained in:
Folke Lemaitre 2025-02-18 21:52:16 +01:00
parent 77204102a1
commit 44e2f8e573
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -179,10 +179,12 @@ end
---@param loc snacks.image.Loc
function M:render_grid(loc)
local hl = "SnacksImage" .. self.id -- image id is encoded in the foreground color
vim.api.nvim_set_hl(0, hl, {
fg = self.img.id,
sp = self.id,
bg = Snacks.image.config.debug.placement and "#FF007C" or nil,
Snacks.util.set_hl({
[hl] = {
fg = self.img.id,
sp = self.id,
bg = Snacks.image.config.debug.placement and "#FF007C" or nil,
},
})
local lines = {} ---@type string[]
for r = 1, loc.height do