AstroNvim / astrotheme

The default colorscheme used by AstroNvim
https://AstroNvim.com
GNU General Public License v3.0
97 stars 19 forks source link

Global highlight customizations not working on v2.2.0 #73

Closed praveenperera closed 1 year ago

praveenperera commented 1 year ago

My theme.lua file

local M = {}

local function config(_, _)
    return {
        palette = "astrodark",
        highlights = {
            global = {
                ["NeogitDiffDeleteHighlight"] = {
                    fg = "#292929",
                    bg = "#f77977",
                },
                ["NeogitDiffAddHighlight"] = {
                    fg = "#292929",
                },
                ["NeogitDiffDelete"] = { fg = "#292929", bg = "#f77977" },
                ["SpelunkerSpellBad"] = { fg = "NONE", bg = "NONE" },
            },
        },
    }
end

M.config = config
return M

init.lua

        {
            "AstroNvim/astrotheme",
            opts = theme.config,
        },

This was working fine until I updated, then the highlight customizations were not working anymore.

Confirmed by downgrading to v2.1.1 customizations working again.

praveenperera commented 1 year ago

Figured it out, had to change how highlights are done, maybe adding a note to the release notes would make sense?

New config

local M = {}

local function config(_, _)
    return {
        palette = "astrodark",
        highlights = {
            global = {
                modify_hl_groups = function(hl, _c)
                    hl.NeogitDiffDeleteHighlight = { fg = "#292929", bg = "#f77977" }
                    hl.NeogitDiffAddHighlight = { fg = "#292929" }
                    hl.NeogitDiffDelete = { fg = "#292929", bg = "#f77977" }
                    hl.SpelunkerSpellBad = { fg = "NONE", bg = "NONE" }
                end,
            },
        },
    }
end

M.config = config
return M

Love the theme changes btw

A-Lamia commented 1 year ago

this is a bug :)

A-Lamia commented 1 year ago

Everything should be merged in later today thanks so much for the report!

praveenperera commented 1 year ago

Well i’m glad I opened the issue then. I wasn’t sure if it was a bug or if I was configuring it wrong. Thanks!