fix(highlights): give user config higher priority (#306)
* fix(highlights): give user config higher priority * Update lua/avante/highlights.lua --------- Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>
This commit is contained in:
parent
fc5f6754a5
commit
1c0623a9df
@ -65,13 +65,13 @@ M.conflict_highlights = function(opts)
|
|||||||
opts = opts or Config.diff.highlights
|
opts = opts or Config.diff.highlights
|
||||||
|
|
||||||
local get_default_colors = function(key, hl)
|
local get_default_colors = function(key, hl)
|
||||||
--- We will first check for the hl name. If plugins set this then we won't use the default opts[var_accesor]
|
--- We will first check for user custom highlight. Then fallback to default name highlight.
|
||||||
local cl
|
local cl
|
||||||
cl = api.nvim_get_hl(0, { name = hl.name })
|
cl = api.nvim_get_hl(0, { name = opts[key:lower()] })
|
||||||
if cl ~= nil then
|
if cl ~= nil then
|
||||||
return cl.bg or hl.bg
|
return cl.bg or hl.bg
|
||||||
end
|
end
|
||||||
cl = api.nvim_get_hl(0, { name = opts[key:lower()] })
|
cl = api.nvim_get_hl(0, { name = hl.name })
|
||||||
return cl.bg or hl.bg
|
return cl.bg or hl.bg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user