mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +00:00
fix(highlight): spurious underline in 'winblend' floating window #34614
Problem: When a floating window with high winblend uses a highlight group with underline (but without guisp), the underline appears red. Solution: Only blend the special color (for underline/undercurl) if the foreground highlight actually has underline or undercurl set. Otherwise, ignore the special color.
This commit is contained in:
@@ -726,11 +726,10 @@ int hl_blend_attrs(int back_attr, int front_attr, bool *through)
|
||||
|
||||
if (*through) {
|
||||
cattrs = battrs;
|
||||
cattrs.rgb_fg_color = rgb_blend(ratio, battrs.rgb_fg_color,
|
||||
fattrs.rgb_bg_color);
|
||||
if (cattrs.rgb_ae_attr & (HL_UNDERLINE_MASK)) {
|
||||
cattrs.rgb_sp_color = rgb_blend(ratio, battrs.rgb_sp_color,
|
||||
fattrs.rgb_bg_color);
|
||||
cattrs.rgb_fg_color = rgb_blend(ratio, battrs.rgb_fg_color, fattrs.rgb_bg_color);
|
||||
// Only apply special colors when the foreground attribute has an underline or undercurl.
|
||||
if (fattrs_raw.rgb_ae_attr & (HL_UNDERLINE | HL_UNDERCURL)) {
|
||||
cattrs.rgb_sp_color = rgb_blend(ratio, battrs.rgb_sp_color, fattrs.rgb_bg_color);
|
||||
} else {
|
||||
cattrs.rgb_sp_color = -1;
|
||||
}
|
||||
@@ -744,11 +743,9 @@ int hl_blend_attrs(int back_attr, int front_attr, bool *through)
|
||||
if (ratio >= 50) {
|
||||
cattrs.rgb_ae_attr = hl_combine_ae(battrs.rgb_ae_attr, cattrs.rgb_ae_attr);
|
||||
}
|
||||
cattrs.rgb_fg_color = rgb_blend(ratio/2, battrs.rgb_fg_color,
|
||||
fattrs.rgb_fg_color);
|
||||
cattrs.rgb_fg_color = rgb_blend(ratio/2, battrs.rgb_fg_color, fattrs.rgb_fg_color);
|
||||
if (cattrs.rgb_ae_attr & (HL_UNDERLINE_MASK)) {
|
||||
cattrs.rgb_sp_color = rgb_blend(ratio/2, battrs.rgb_bg_color,
|
||||
fattrs.rgb_sp_color);
|
||||
cattrs.rgb_sp_color = rgb_blend(ratio/2, battrs.rgb_bg_color, fattrs.rgb_sp_color);
|
||||
} else {
|
||||
cattrs.rgb_sp_color = -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user