File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,17 @@ function M.set_palettes(opts)
5555end
5656
5757function M .set_highlights (opts , highlights , theme )
58- pcall ( opts .highlights .global . modify_hl_groups , highlights , C )
59- pcall ( opts .highlights [theme ]. modify_hl_groups , highlights , C )
58+ local global_hl = opts .highlights .global
59+ local theme_hl = opts .highlights [theme ]
6060
61- for group , spec in pairs (highlights ) do
62- vim .api .nvim_set_hl (0 , group , spec )
61+ pcall (global_hl .modify_hl_groups , highlights , C )
62+ pcall (theme_hl .modify_hl_groups , highlights , C )
63+
64+ highlights = vim .tbl_deep_extend (" force" , highlights , global_hl , theme_hl )
65+
66+ for name , value in pairs (highlights ) do
67+ -- TODO: optimise in V3 by removing checks.
68+ if name ~= " modify_hl_groups" then vim .api .nvim_set_hl (0 , name , value ) end
6369 end
6470end
6571
You can’t perform that action at this time.
0 commit comments