Skip to content

Commit

Permalink
fix(highlight): apply fallback even if not defined
Browse files Browse the repository at this point in the history
Fixes: #729
  • Loading branch information
lewis6991 committed Jan 27, 2023
1 parent c52162b commit 0d4fe37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lua/gitsigns/highlight.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion teal/gitsigns/highlight.tl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d4fe37

Please sign in to comment.