66
66
M .combine = function (foreground , background )
67
67
local name = string.format (' %s_%s_%s' , M .prefix , foreground , background )
68
68
if not vim .tbl_contains (cache .highlights , name ) then
69
- local fg = M .get_hl (foreground ).fg
70
- local bg = M .get_hl (background ).bg
71
- vim .api .nvim_set_hl (0 , name , { fg = fg , bg = bg })
69
+ local fg = M .get_hl (foreground )
70
+ local bg = M .get_hl (background )
71
+ vim .api .nvim_set_hl (0 , name , {
72
+ fg = fg .fg ,
73
+ bg = bg .bg ,
74
+ ctermfg = fg .ctermfg ,
75
+ ctermbg = bg .ctermbg ,
76
+ })
72
77
table.insert (cache .highlights , name )
73
78
end
74
79
return name
@@ -80,7 +85,12 @@ M.inverse = function(highlight)
80
85
local name = string.format (' %s_Inverse_%s' , M .prefix , highlight )
81
86
if not vim .tbl_contains (cache .highlights , name ) then
82
87
local hl = M .get_hl (highlight )
83
- vim .api .nvim_set_hl (0 , name , { fg = hl .bg , bg = hl .fg })
88
+ vim .api .nvim_set_hl (0 , name , {
89
+ fg = hl .bg ,
90
+ bg = hl .fg ,
91
+ ctermbg = hl .ctermfg ,
92
+ ctermfg = hl .ctermbg ,
93
+ })
84
94
table.insert (cache .highlights , name )
85
95
end
86
96
return name
0 commit comments