patch 9.2.0034: redundant code in hl_blend_attr()
Commit:
https://github.com/vim/vim/commit/2ab37c07a8141bfd36719d2a47539062c28c0316
Author: Christian Brabandt <[email protected]>
Date: Sat Feb 21 09:39:35 2026 +0000
patch 9.2.0034: redundant code in hl_blend_attr()
Problem: Redundant code in hl_blend_attr()
(Coverity, after v9.2.0017)
Solution: Remove redundant if/else logic, remove redundant braces.
related: #19272
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/highlight.c b/src/highlight.c
index 5df56b100..2d524bcb3 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -3219,17 +3219,10 @@ hl_blend_attr(int char_attr, int popup_attr, int blend,
int blend_fg UNUSED)
{
// Blend foreground color
if (popup_aep->ae_u.cterm.fg_color > 0)
- {
- if (new_en.ae_u.cterm.fg_color > 0)
- new_en.ae_u.cterm.fg_color =
popup_aep->ae_u.cterm.fg_color;
- else
- new_en.ae_u.cterm.fg_color =
popup_aep->ae_u.cterm.fg_color;
- }
+ new_en.ae_u.cterm.fg_color = popup_aep->ae_u.cterm.fg_color;
// Use popup background color (cterm colors don't support
blending)
if (popup_aep->ae_u.cterm.bg_color > 0)
- {
new_en.ae_u.cterm.bg_color = popup_aep->ae_u.cterm.bg_color;
- }
#ifdef FEAT_TERMGUICOLORS
// Blend RGB colors for termguicolors mode
if (blend_fg)
@@ -3243,10 +3236,8 @@ hl_blend_attr(int char_attr, int popup_attr, int blend,
int blend_fg UNUSED)
}
}
else if (popup_aep->ae_u.cterm.fg_rgb != INVALCOLOR)
- {
// blend_fg=FALSE: use popup foreground
new_en.ae_u.cterm.fg_rgb = popup_aep->ae_u.cterm.fg_rgb;
- }
if (popup_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
{
// Always use popup background, fade to black based on blend
diff --git a/src/version.c b/src/version.c
index c2cc8137d..b7510a5e9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 34,
/**/
33,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vtjmQ-005dQi-0J%40256bit.org.