diff --git a/lua/gitsigns/highlight.lua b/lua/gitsigns/highlight.lua index 212cbca..cfe6f4d 100644 --- a/lua/gitsigns/highlight.lua +++ b/lua/gitsigns/highlight.lua @@ -185,9 +185,17 @@ local function derive(hl, hldef) else vim.api.nvim_set_hl(0, hl, { default = true, link = d }) end - break + return end end + if hldef[1] and not hldef.bg_factor and not hldef.fg_factor then + + + dprintf('Deriving %s from %s', hl, hldef[1]) + vim.api.nvim_set_hl(0, hl, { default = true, link = hldef[1] }) + else + dprintf('Could not derive %s', hl) + end end diff --git a/teal/gitsigns/highlight.tl b/teal/gitsigns/highlight.tl index 0fe17c8..6d25a7e 100644 --- a/teal/gitsigns/highlight.tl +++ b/teal/gitsigns/highlight.tl @@ -185,9 +185,17 @@ local function derive(hl: string, hldef: Hldef) else vim.api.nvim_set_hl(0, hl, {default = true, link = d }) end - break + return end end + if hldef[1] and not hldef.bg_factor and not hldef.fg_factor then + -- No fallback found which is set. Just link to the first fallback + -- if there are no modifiers + dprintf('Deriving %s from %s', hl, hldef[1]) + vim.api.nvim_set_hl(0, hl, {default = true, link = hldef[1] }) + else + dprintf('Could not derive %s', hl) + end end -- Setup a GitSign* highlight by deriving it from other potentially present