patch 9.2.0520: Reversed text opacity in popup when termguicolor is set
Commit:
https://github.com/vim/vim/commit/d7e6ce7a767209ed046c8cb04091b47128892954
Author: Shad <[email protected]>
Date: Sat May 23 18:43:09 2026 +0000
patch 9.2.0520: Reversed text opacity in popup when termguicolor is set
Problem: When termguicolor is set, popup opacity seems reversed
for the underlying text: when opacity go from 1 to 99,
the greater opacity is, the more underlying text is readable.
Solution: Invert popup_color and base_fg when calling blend_colors
(Shad).
fixes: #20283
closes: #20284
Signed-off-by: Shad <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/highlight.c b/src/highlight.c
index 3b1886be0..2f92a2e52 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -3303,7 +3303,7 @@ blend_cterm_colors(int popup_c, guicolor_T popup_rgb,
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
/*
* Blend two RGB colors based on blend value (0-100).
- * blend: 0=use popup color, 100=use background color
+ * blend: 0=return first argument color, 100=return second argument color
* If bg_color is INVALCOLOR, high blend means more visible (return
INVALCOLOR).
*/
static guicolor_T
@@ -3397,7 +3397,7 @@ hl_blend_attr(int char_attr, int popup_attr, int blend,
int blend_fg UNUSED)
&& char_aep->ae_u.gui.fg_color != INVALCOLOR)
base_fg = char_aep->ae_u.gui.fg_color;
new_en.ae_u.gui.fg_color = blend_colors(
- base_fg, popup_aep->ae_u.gui.bg_color, blend);
+ popup_aep->ae_u.gui.bg_color, base_fg, blend);
}
}
else
@@ -3537,7 +3537,7 @@ hl_blend_attr(int char_attr, int popup_attr, int blend,
int blend_fg UNUSED)
&&
!COLOR_INVALID(char_aep->ae_u.cterm.fg_rgb))
base_fg = char_aep->ae_u.cterm.fg_rgb;
new_en.ae_u.cterm.fg_rgb = blend_colors(
- base_fg, popup_bg, blend);
+ popup_bg, base_fg, blend);
}
}
else
diff --git a/src/testdir/dumps/Test_popupwin_opacity_textprop_undercurl.dump
b/src/testdir/dumps/Test_popupwin_opacity_textprop_undercurl.dump
index 2d29cfdea..489b0dbbc 100644
--- a/src/testdir/dumps/Test_popupwin_opacity_textprop_undercurl.dump
+++ b/src/testdir/dumps/Test_popupwin_opacity_textprop_undercurl.dump
@@ -1,6 +1,6 @@
->a+0&#ffffff0@2| |b@2|
|c|P+0#e5e9f0255#03050b255|O|P|U|P|d+0#61646f255&|C+0#e5e9f0255&|O|N|T|E|N|T|f+0#61646f255&|
|g@2| |h@2| @7| +0#0000000#ffffff0@10
-|i@2| |j@2| |k|k+0#61646f255#03050b255@1| |l@2| |m@2| |n@2| |o@2| |p@2| @7|
+0#0000000#ffffff0@10
-|q@2| |r@2| |s|s+0#61646f255#03050b255@1|
|m+0#e5e9f0255&|i|d@1|l|e|u+0#61646f255&| |v@2| |w@2| |x@2| @7|
+0#0000000#ffffff0@10
+>a+0&#ffffff0@2| |b@2|
|c|P+0#e5e9f0255#03050b255|O|P|U|P|d+0#a9abb1255&|C+0#e5e9f0255&|O|N|T|E|N|T|f+0#a9abb1255&|
|g@2| |h@2| @7| +0#0000000#ffffff0@10
+|i@2| |j@2| |k|k+0#a9abb1255#03050b255@1| |l@2| |m@2| |n@2| |o@2| |p@2| @7|
+0#0000000#ffffff0@10
+|q@2| |r@2| |s|s+0#a9abb1255#03050b255@1|
|m+0#e5e9f0255&|i|d@1|l|e|u+0#a9abb1255&| |v@2| |w@2| |x@2| @7|
+0#0000000#ffffff0@10
|y@2| |z@2| |1@2| |2@2| |3@2| |4@2| |5@2| |6@2| @18
|~+0#0000ff255&| @48
|~| @48
diff --git a/src/testdir/dumps/Test_popupwin_opacity_vsplit_1.dump
b/src/testdir/dumps/Test_popupwin_opacity_vsplit_1.dump
index 825706cef..d6179c249 100644
--- a/src/testdir/dumps/Test_popupwin_opacity_vsplit_1.dump
+++ b/src/testdir/dumps/Test_popupwin_opacity_vsplit_1.dump
@@ -1,6 +1,6 @@
>r+0&#ffffff0|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3|
>@2||+1&&|l+0&&|e|f|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
-|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t|
|o+0#ffffff255#000045255|p|a|c|i|t|y|x+0#8080c5255&|o+0#ffffff255&|v|e|r||+1#8080c5255&|v+0#ffffff255&|s|p|l|i|t|i+0#8080c5255&|n|d|o|w|
|t+0#0000000#ffffff0|e|x|t| |h|e|r|e| |x@3| @2
+|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t|
|o+0#ffffff255#000045255|p|a|c|i|t|y|x+0#7f7fc5255&|o+0#ffffff255&|v|e|r||+1#7f7fc5255&|v+0#ffffff255&|s|p|l|i|t|i+0#7f7fc5255&|n|d|o|w|
|t+0#0000000#ffffff0|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
diff --git a/src/testdir/dumps/Test_popupwin_opacity_vsplit_2.dump
b/src/testdir/dumps/Test_popupwin_opacity_vsplit_2.dump
index 4b766456d..3fa171461 100644
--- a/src/testdir/dumps/Test_popupwin_opacity_vsplit_2.dump
+++ b/src/testdir/dumps/Test_popupwin_opacity_vsplit_2.dump
@@ -1,6 +1,6 @@
|r+0&#ffffff0|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3|
@2||+1&&|l+0&&|e|f|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
-|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t|
|o+0#ffffff255#000045255|p|a|c|i|t|y|x+0#8080c5255&|o+0#ffffff255&|v|e|r||+1#8080c5255&|v+0#ffffff255&|s|p|l|i|t|i+0#8080c5255&|n|d|o|w|
|t+0#0000000#ffffff0|e|x|t| |h|e|r|e| |x@3| @2
+|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t|
|o+0#ffffff255#000045255|p|a|c|i|t|y|x+0#7f7fc5255&|o+0#ffffff255&|v|e|r||+1#7f7fc5255&|v+0#ffffff255&|s|p|l|i|t|i+0#7f7fc5255&|n|d|o|w|
|t+0#0000000#ffffff0|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
|r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
>r|i|g|h|t| |w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2||+1&&|l+0&&|e|f|t|
>|w|i|n|d|o|w| |t|e|x|t| |h|e|r|e| |x@3| @2
diff --git a/src/testdir/dumps/Test_popupwin_opacity_wide_1.dump
b/src/testdir/dumps/Test_popupwin_opacity_wide_1.dump
index 875430044..c712253f4 100644
--- a/src/testdir/dumps/Test_popupwin_opacity_wide_1.dump
+++ b/src/testdir/dumps/Test_popupwin_opacity_wide_1.dump
@@ -1,9 +1,9 @@
->い*0&#ffffff0|え*0#e08080255#600000255|ー@6| +&| +0#0000000#ffffff0|ー*&@7|い|!+&|
|1| @3
-|い*&| +0#e08080255#600000255|カ*0#ffffff255&|ラ|フ|ル|な| +0#e08080255&|ー*&@1| +&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |2| @3
-|い*&|
+0#e08080255#600000255|ポ*0#ffffff255#600030255|ッ|プ|ア|ッ|プ|で|─+0#e08080255&|╮|
+0#0000000#ffffff0|ー*&@7|い|!+&| |3| @3
-|い*&| +0#e08080255#600000255|最*0#ffffff255#600030255|上|川|
+0#e08080255&|ぼ*&|赤|い|な|│+&| +0#0000000#ffffff0|ー*&@7|い|!+&| |4| @3
-|い*&|
+0#e08080255#600000255|│+0�|あ*&|い|う|え|お|ー*0#a04070255&@1|│+0#e08080255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
-|い*&| +&|│+0#ffffff255#000060255|ー*0#8080e0255&@6|│+0#ffffff255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |6| @3
+>い*0&#ffffff0|え*0#df7f7f255#600000255|ー@6| +&| +0#0000000#ffffff0|ー*&@7|い|!+&|
|1| @3
+|い*&| +0#df7f7f255#600000255|カ*0#ffffff255&|ラ|フ|ル|な| +0#df7f7f255&|ー*&@1| +&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |2| @3
+|い*&|
+0#df7f7f255#600000255|ポ*0#ffffff255#600030255|ッ|プ|ア|ッ|プ|で|─+0#df7f7f255&|╮|
+0#0000000#ffffff0|ー*&@7|い|!+&| |3| @3
+|い*&| +0#df7f7f255#600000255|最*0#ffffff255#600030255|上|川|
+0#df7f7f255&|ぼ*&|赤|い|な|│+&| +0#0000000#ffffff0|ー*&@7|い|!+&| |4| @3
+|い*&|
+0#df7f7f255#600000255|│+0�|あ*&|い|う|え|お|ー*0#a03f6f255&@1|│+0#df7f7f255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
+|い*&| +&|│+0#ffffff255#000060255|ー*0#7f7fdf255&@6|│+0#ffffff255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |6| @3
|い*&| +&|╰+0#ffffff255#000060255|─@13|╯| +0#0000000#ffffff0|ー*&@7|い|!+&| |7| @3
|い*&|え|ー@15|い|!+&| |8| @3
|い*&|え|ー@15|い|!+&| |9| @3
diff --git a/src/testdir/dumps/Test_popupwin_opacity_wide_2.dump
b/src/testdir/dumps/Test_popupwin_opacity_wide_2.dump
index df2e6c09b..40c5dca85 100644
--- a/src/testdir/dumps/Test_popupwin_opacity_wide_2.dump
+++ b/src/testdir/dumps/Test_popupwin_opacity_wide_2.dump
@@ -2,12 +2,12 @@
|い*&|え|ー@15|い|!+&| |2| @3
|い*&| +&|╭+0#ffffff255#000060255|─@13|╮| +0#0000000#ffffff0|ー*&@7|い|!+&| |3| @3
|い*&| +&|│+0#ffffff255#000060255|あ*&|め|ん|ぼ|赤|い|な|│+&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |4| @3
-|い*&| +&|│+0#ffffff255#000060255|あ*&|い|う|え|お|ー*0#8080e0255&@1|│+0#ffffff255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
-|い*&| +&|│+0#ffffff255#000060255|ー*0#8080e0255&@4| +&|
+0#a04070255#600030255|ー*&|│+0#e08080255&|
+0�|ー*&@5|ー*0#0000000#ffffff0@1|い|!+&| |6| @3
-|い*&|
+&|╰+0#ffffff255#000060255|─@10|─+0#e08080255#600030255|カ*0#ffffff255&|ラ*0�|フ|ル|な|ー*0#e08080255&@2|ー*0#0000000#ffffff0@1|い|!+&|
|7| @3
-|い*&|え|ー@4| +&|
+0#e08080255#600000255|ポ*0#ffffff255&|ッ|プ|ア|ッ|プ|で|ー*0#e08080255&|ー*0#0000000#ffffff0@1|い|!+&|
|8| @3
-|い*&|え|ー@4| +&|
+0#e08080255#600000255|最*0#ffffff255&|上|川|ー*0#e08080255&@4|ー*0#0000000#ffffff0@1|い|!+&|
|9| @3
-|い*&|え|ー@4| +&| +0#e08080255#600000255|ー*&@7|ー*0#0000000#ffffff0@1|い|!+&|
|1|0| @2
+|い*&| +&|│+0#ffffff255#000060255|あ*&|い|う|え|お|ー*0#7f7fdf255&@1|│+0#ffffff255&|
+0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
+|い*&| +&|│+0#ffffff255#000060255|ー*0#7f7fdf255&@4| +&|
+0#a03f6f255#600030255|ー*&|│+0#df7f7f255&|
+0�|ー*&@5|ー*0#0000000#ffffff0@1|い|!+&| |6| @3
+|い*&|
+&|╰+0#ffffff255#000060255|─@10|─+0#df7f7f255#600030255|カ*0#ffffff255&|ラ*0�|フ|ル|な|ー*0#df7f7f255&@2|ー*0#0000000#ffffff0@1|い|!+&|
|7| @3
+|い*&|え|ー@4| +&|
+0#df7f7f255#600000255|ポ*0#ffffff255&|ッ|プ|ア|ッ|プ|で|ー*0#df7f7f255&|ー*0#0000000#ffffff0@1|い|!+&|
|8| @3
+|い*&|え|ー@4| +&|
+0#df7f7f255#600000255|最*0#ffffff255&|上|川|ー*0#df7f7f255&@4|ー*0#0000000#ffffff0@1|い|!+&|
|9| @3
+|い*&|え|ー@4| +&| +0#df7f7f255#600000255|ー*&@7|ー*0#0000000#ffffff0@1|い|!+&|
|1|0| @2
|い*&|え|ー@15|い|!+&| |1@1| @2
|い*&|え|ー@15|い|!+&| |1|2| @2
|い*&|え|ー@15|い|!+&| |1|3| @2
diff --git a/src/version.c b/src/version.c
index 10480a3c8..2b51332c9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 520,
/**/
519,
/**/
--
--
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/E1wQrZs-002jWX-BZ%40256bit.org.