Skip to content

Commit ecd5253

Browse files
authored
Fix code highlight border with notermguicolors (#81)
* Fix code highlight border with notermguicolors * Fix colors.combine for notermguicolors
1 parent 123048b commit ecd5253

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

lua/render-markdown/colors.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,14 @@ end
6666
M.combine = function(foreground, background)
6767
local name = string.format('%s_%s_%s', M.prefix, foreground, background)
6868
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+
})
7277
table.insert(cache.highlights, name)
7378
end
7479
return name
@@ -80,7 +85,12 @@ M.inverse = function(highlight)
8085
local name = string.format('%s_Inverse_%s', M.prefix, highlight)
8186
if not vim.tbl_contains(cache.highlights, name) then
8287
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+
})
8494
table.insert(cache.highlights, name)
8595
end
8696
return name

0 commit comments

Comments
 (0)