diff --git a/lua/hunk/api/highlights.lua b/lua/hunk/api/highlights.lua index 86f9466..a833f5e 100644 --- a/lua/hunk/api/highlights.lua +++ b/lua/hunk/api/highlights.lua @@ -6,15 +6,28 @@ function M.set_win_hl(winid, highlights) }) end +local function color_as_hex(color) + if not color then + return + end + return string.format("#%06x", color) +end + function M.define_highlights() local diff_delete_highlight = vim.api.nvim_get_hl(0, { name = "DiffDelete", link = true, }) - vim.api.nvim_set_hl(0, "HunkDiffAddAsDelete", { - bg = string.format("#%06x", diff_delete_highlight.bg), - }) + vim.api.nvim_set_hl( + 0, + "HunkDiffAddAsDelete", + vim.tbl_deep_extend("force", diff_delete_highlight, { + bg = color_as_hex(diff_delete_highlight.bg), + fg = color_as_hex(diff_delete_highlight.fg), + sp = color_as_hex(diff_delete_highlight.sp), + }) + ) vim.api.nvim_set_hl(0, "HunkDiffDeleteDim", { default = true,