Skip to content

Commit

Permalink
fix: invalid alpha (>1) when length > cc
Browse files Browse the repository at this point in the history
bekaboo committed Jan 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 6c1f35c commit 40a1ddd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/deadcolumn.lua
Original file line number Diff line number Diff line change
@@ -169,7 +169,11 @@ local function setup(opts)
end
local new_cc_color = show_warning
and colors.cblend(C_ERROR, C_NORMAL, configs.opts.warning.alpha).dec
or colors.cblend(C_CC, C_NORMAL, (length - thresh) / (cc - thresh)).dec
or colors.cblend(
C_CC,
C_NORMAL,
math.min(1, (length - thresh) / (cc - thresh))
).dec
if new_cc_color ~= cc_bg then
cc_bg = new_cc_color
vim.api.nvim_set_hl(0, '_ColorColumn', {

0 comments on commit 40a1ddd

Please sign in to comment.