Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(highlight): apply fallback even if not defined #730

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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