diff options
| author | Ellison <ellisonleao@gmail.com> | 2023-03-25 16:19:08 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-25 16:19:08 -0300 |
| commit | 8fc2d6ef800a15c8dc71c1570c8b85e8ceb3087c (patch) | |
| tree | c0f347e56ae2195796a4fe81096bf05292972a82 /lua | |
| parent | 3f6bc0c808dd6ecb154cb637d5104f92305c1026 (diff) | |
| download | gruvbox-8fc2d6ef800a15c8dc71c1570c8b85e8ceb3087c.tar.gz gruvbox-8fc2d6ef800a15c8dc71c1570c8b85e8ceb3087c.tar.xz | |
fixing override logic (#226)
Ref #223
Reverting #207
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/gruvbox/groups.lua | 12 | ||||
| -rw-r--r-- | lua/gruvbox/palette.lua | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/lua/gruvbox/groups.lua b/lua/gruvbox/groups.lua index a3f5712..d12a88b 100644 --- a/lua/gruvbox/groups.lua +++ b/lua/gruvbox/groups.lua @@ -787,16 +787,12 @@ M.setup = function() } for group, hl in pairs(config.overrides) do - -- When `link` is set together with other attrs, only `link` will take effect. - -- e.g. `{ link = "GruvboxRed", fg = colors.blue }` The final color is red. - -- Dereference the `link` and let user overrides it's attr. - local link = nil - if groups[group] and not vim.tbl_isempty(hl) then - link = groups[group]["link"] - groups[group]["link"] = nil + if groups[group] then + -- "link" should not mix with other configs (:h hi-link) + groups[group].link = nil end - groups[group] = vim.tbl_extend("force", groups[group] or {}, groups[link] or {}, hl) + groups[group] = vim.tbl_extend("force", groups[group] or {}, hl) end return groups diff --git a/lua/gruvbox/palette.lua b/lua/gruvbox/palette.lua index 178f94e..9c410a4 100644 --- a/lua/gruvbox/palette.lua +++ b/lua/gruvbox/palette.lua @@ -52,8 +52,8 @@ M.get_base_colors = function(bg, contrast) local config = require("gruvbox").config local p = M.colors - for k, v in pairs(config.palette_overrides) do - p[k] = v + for color, hex in pairs(config.palette_overrides) do + p[color] = hex end if bg == nil then |
