diff options
| author | 秋葉 <ambiguous404@gmail.com> | 2023-03-13 10:38:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-12 23:38:28 -0300 |
| commit | c6ef9c5a3a2ece0f8635460291eb4a4c06ed3dcc (patch) | |
| tree | 94f5aaae929a791eea1efb8a96d2eec96c61bbba /lua | |
| parent | f03cea2e0e4b1265699e89b344f425e3d33a94e3 (diff) | |
| download | gruvbox-c6ef9c5a3a2ece0f8635460291eb4a4c06ed3dcc.tar.gz gruvbox-c6ef9c5a3a2ece0f8635460291eb4a4c06ed3dcc.tar.xz | |
Fix(color): fix the custom attribute does not take effect. #205 (#207)
Co-authored-by: Ellison <ellisonleao@gmail.com>
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/gruvbox/groups.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lua/gruvbox/groups.lua b/lua/gruvbox/groups.lua index 318d3ed..a65cc25 100644 --- a/lua/gruvbox/groups.lua +++ b/lua/gruvbox/groups.lua @@ -785,10 +785,16 @@ 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 - groups[group].link = nil + link = groups[group]["link"] + groups[group]["link"] = nil end - groups[group] = vim.tbl_extend("force", groups[group] or {}, hl) + + groups[group] = vim.tbl_extend("force", groups[group] or {}, groups[link] or {}, hl) end return groups |
