]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0520: Reversed text opacity in popup when termguicolor is set v9.2.0520
authorShad <shadow.walker@free.fr>
Sat, 23 May 2026 18:43:09 +0000 (18:43 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 23 May 2026 18:43:09 +0000 (18:43 +0000)
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 <shadow.walker@free.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/highlight.c
src/testdir/dumps/Test_popupwin_opacity_textprop_undercurl.dump
src/testdir/dumps/Test_popupwin_opacity_vsplit_1.dump
src/testdir/dumps/Test_popupwin_opacity_vsplit_2.dump
src/testdir/dumps/Test_popupwin_opacity_wide_1.dump
src/testdir/dumps/Test_popupwin_opacity_wide_2.dump
src/version.c

index 3b1886be0ec552134e6dc968104742f3051143c5..2f92a2e52b23d540066db5c2ff94f33ce17c42fb 100644 (file)
@@ -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
index 2d29cfdeaf1f73014c3696a8fddba91e682f19ee..489b0dbbc1eab2523d5da9720df1833685994ca6 100644 (file)
@@ -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
index 825706cef436c0e7a13b9bff517ae0a0ccb9030c..d6179c2499191dd2759780da943463de32bdf417 100644 (file)
@@ -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
index 4b766456da133fb84439af30de1a90d40ca0c397..3fa171461d312c0130175f43d111965e1f3b44f6 100644 (file)
@@ -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
index 875430044bd9d66cca0c7f7c48d6d6bb2de296b2..c712253f47be288df0a4914cc6a0228313230a59 100644 (file)
@@ -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&#600030255|あ*&|い|う|え|お|ー*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&#600030255|あ*&|い|う|え|お|ー*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
index df2e6c09b8976bf17f4030ce01410fb770f64254..40c5dca85cb0ac347e3449c585053063219e1bfd 100644 (file)
@@ -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&#600000255|ー*&@5|ー*0#0000000#ffffff0@1|い|!+&| |6| @3
-|い*&| +&|╰+0#ffffff255#000060255|─@10|─+0#e08080255#600030255|カ*0#ffffff255&|ラ*0&#600000255|フ|ル|な|ー*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&#600000255|ー*&@5|ー*0#0000000#ffffff0@1|い|!+&| |6| @3
+|い*&| +&|╰+0#ffffff255#000060255|─@10|─+0#df7f7f255#600030255|カ*0#ffffff255&|ラ*0&#600000255|フ|ル|な|ー*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
index 10480a3c804b347821e7def9ee63f04ca973b897..2b51332c9c5ee76b509c16b567f819a4fa3a31d2 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    520,
 /**/
     519,
 /**/