EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR);
EXTERN guicolor_T cterm_normal_ul_gui_color INIT(= INVALCOLOR);
#endif
+EXTERN guicolor_T fallback_fg_rgb INIT(= INVALCOLOR); // RGB fallback foreground color from guifg, ctermfg or deduced from 'background'
+EXTERN guicolor_T fallback_bg_rgb INIT(= INVALCOLOR); // RGB fallback background color from guibg, ctermbg or deduced from 'background'
#ifdef FEAT_TERMRESPONSE
EXTERN int is_mac_terminal INIT(= FALSE); // recognized Terminal.app
#endif
}
#endif
+static void resolve_fallback_fg_to_rgb(void);
+static void resolve_fallback_bg_to_rgb(void);
+
void
init_highlight(
int both, // include groups where 'bg' doesn't matter
}
}
#endif
+ resolve_fallback_fg_to_rgb();
+ resolve_fallback_bg_to_rgb();
}
#if defined(FEAT_EVAL) && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS))
redraw_all_later(UPD_NOT_VALID);
}
#endif
+ resolve_fallback_fg_to_rgb();
+ resolve_fallback_bg_to_rgb();
#ifdef FEAT_VTP
control_console_color_rgb();
#endif
cterm_normal_bg_gui_color = INVALCOLOR;
cterm_normal_ul_gui_color = INVALCOLOR;
# endif
+ fallback_fg_rgb = INVALCOLOR;
+ fallback_bg_rgb = INVALCOLOR;
#endif
}
return false;
}
+/*
+ * get a RGB fallback color from gui, cterm or default color
+ */
+ static guicolor_T
+resolve_fallback_color(int cterm_c, guicolor_T rgb, guicolor_T default_rgb)
+{
+ int red, green, blue;
+ if (!resolve_color_to_rgb(cterm_c, rgb, &red, &green, &blue))
+ return default_rgb;
+ else
+ return (red << 16) | (green << 8) | blue;
+}
+
+/*
+ * get a RGB fallback foreground color from guifg, ctermfg or deduced from background
+ */
+ static void
+resolve_fallback_fg_to_rgb(void)
+{
+ guicolor_T fgcolor_or_gui_fgcolor = INVALCOLOR;
+#ifdef FEAT_TERMGUICOLORS
+ fgcolor_or_gui_fgcolor = cterm_normal_fg_gui_color;
+#endif
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ fgcolor_or_gui_fgcolor = gui.norm_pixel;
+#endif
+ fallback_fg_rgb = resolve_fallback_color(cterm_normal_fg_color, fgcolor_or_gui_fgcolor, (*p_bg == 'l') ? 0x000000 : 0xFFFFFF);
+}
+
+/*
+ * get a RGB fallback background color from guifg, ctermbg or deduced from background
+ */
+ static void
+resolve_fallback_bg_to_rgb(void)
+{
+ guicolor_T bgcolor_or_gui_bgcolor = INVALCOLOR;
+#ifdef FEAT_TERMGUICOLORS
+ bgcolor_or_gui_bgcolor = cterm_normal_bg_gui_color;
+#endif
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ bgcolor_or_gui_bgcolor = gui.back_pixel;
+#endif
+ fallback_bg_rgb = resolve_fallback_color(cterm_normal_bg_color, bgcolor_or_gui_bgcolor, (*p_bg == 'l') ? 0xFFFFFF : 0x000000);
+}
+
/*
* Blend two colors expressed as (cterm 256 index, gui RGB) pairs and
* return the nearest 1-based cterm 256-color index. Prefers the gui
b1 = popup_color & 0xFF;
if (COLOR_INVALID(bg_color))
- {
- // Background color unknown: fade popup color to black as blend increases
- // This makes background text more visible at high blend values
- r = r1 * (100 - blend_val) / 100;
- g = g1 * (100 - blend_val) / 100;
- b = b1 * (100 - blend_val) / 100;
- return (r << 16) | (g << 8) | b;
- }
+ bg_color = fallback_bg_rgb;
r2 = (bg_color >> 16) & 0xFF;
g2 = (bg_color >> 8) & 0xFF;
// blend_fg=TRUE: fade underlying text toward popup bg.
if (popup_aep->ae_u.gui.bg_color != INVALCOLOR)
{
- int base_fg = 0xFFFFFF;
+ int base_fg = fallback_fg_rgb;
if (char_aep != NULL
&& char_aep->ae_u.gui.fg_color != INVALCOLOR)
base_fg = char_aep->ae_u.gui.fg_color;
// Blend background color: blend popup bg toward underlying bg
if (popup_aep->ae_u.gui.bg_color != INVALCOLOR)
{
- guicolor_T underlying_bg = INVALCOLOR;
+ guicolor_T underlying_bg = fallback_bg_rgb;
if (char_aep != NULL)
underlying_bg = char_aep->ae_u.gui.bg_color;
new_en.ae_u.gui.bg_color = blend_colors(
#endif
new_en.ae_u.cterm.fg_color = blend_cterm_colors(
popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
- under_fg, under_fg_rgb, 0xFFFFFF, blend);
+ under_fg, under_fg_rgb, fallback_fg_rgb, blend);
}
// Approximate cterm bg by blending with the underlying bg
// in the 256-color palette and mapping to the nearest entry.
#endif
new_en.ae_u.cterm.bg_color = blend_cterm_colors(
popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
- under_bg, under_bg_rgb, 0x000000, blend);
+ under_bg, under_bg_rgb, fallback_bg_rgb, blend);
}
#ifdef FEAT_TERMGUICOLORS
// Blend RGB colors for termguicolors mode.
// blend_fg=TRUE: fade underlying text toward popup bg.
if (popup_bg != INVALCOLOR)
{
- int base_fg = 0xFFFFFF;
+ int base_fg = fallback_fg_rgb;
// CTERMCOLOR is a sentinel meaning "use the cterm
// color"; treat it as no underlying color so it is
// not blended in as a real near-white pixel.
else if (!COLOR_INVALID(cterm_normal_fg_gui_color))
new_en.ae_u.cterm.fg_rgb = cterm_normal_fg_gui_color;
else
- new_en.ae_u.cterm.fg_rgb = 0xFFFFFF;
+ new_en.ae_u.cterm.fg_rgb = fallback_fg_rgb;
}
if (popup_bg != INVALCOLOR)
{
// Blend popup bg toward underlying bg
- guicolor_T underlying_bg = INVALCOLOR;
+ guicolor_T underlying_bg = fallback_bg_rgb;
if (char_aep != NULL
&& !COLOR_INVALID(char_aep->ae_u.cterm.bg_rgb))
underlying_bg = char_aep->ae_u.cterm.bg_rgb;
// blend=100 (transparent): fg = underlying_fg (text visible)
if (popup_aep->ae_u.gui.bg_color != INVALCOLOR)
{
- int base_fg = 0xFFFFFF;
+ int base_fg = fallback_fg_rgb;
if (char_aep != NULL
&& char_aep->ae_u.gui.fg_color != INVALCOLOR)
base_fg = char_aep->ae_u.gui.fg_color;
// Blend bg: popup bg toward underlying bg.
if (popup_aep->ae_u.gui.bg_color != INVALCOLOR)
{
- guicolor_T underlying_bg = INVALCOLOR;
+ guicolor_T underlying_bg = fallback_bg_rgb;
if (char_aep != NULL)
underlying_bg = char_aep->ae_u.gui.bg_color;
new_en.ae_u.gui.bg_color = blend_colors(
#endif
new_en.ae_u.cterm.fg_color = blend_cterm_colors(
popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
- under_fg, under_fg_rgb, 0xFFFFFF, blend);
+ under_fg, under_fg_rgb, fallback_fg_rgb, blend);
}
// Approximate cterm bg by blending with the underlying bg
// in the 256-color palette and mapping to the nearest entry.
#endif
new_en.ae_u.cterm.bg_color = blend_cterm_colors(
popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
- under_bg, under_bg_rgb, 0x000000, blend);
+ under_bg, under_bg_rgb, fallback_bg_rgb, blend);
}
#ifdef FEAT_TERMGUICOLORS
// Blend fg_rgb: pum_bg toward underlying_fg.
// as a real near-white pixel.
if (popup_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
{
- int base_fg = 0xFFFFFF;
+ int base_fg = fallback_fg_rgb;
if (char_aep != NULL
&& !COLOR_INVALID(char_aep->ae_u.cterm.fg_rgb))
base_fg = char_aep->ae_u.cterm.fg_rgb;
// Blend bg_rgb.
if (popup_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
{
- guicolor_T underlying_bg = INVALCOLOR;
+ guicolor_T underlying_bg = fallback_bg_rgb;
if (char_aep != NULL
&& !COLOR_INVALID(char_aep->ae_u.cterm.bg_rgb))
underlying_bg = char_aep->ae_u.cterm.bg_rgb;
>a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y
|z| @23
-|a|b|c|d|e|f|g|h|i|j|k|╔+0#0000001#875f87255|═@4|╗|s+0#0000000#ffffff0|t|u|v|w|x|y
-|z| @9|║+0#0000001#875f87255|A| +0#ffd7ff255&@3|║+0#0000001&| +0#0000000#ffffff0@6
-|a|b|c|d|e|f|g|h|i|j|k|╚+0#0000001#875f87255|═@4|╝|s+0#0000000#ffffff0|t|u|v|w|x|y
+|a|b|c|d|e|f|g|h|i|j|k|╔+0#0000001#ffd7ff255|═@4|╗|s+0#0000000#ffffff0|t|u|v|w|x|y
+|z| @9|║+0#0000001#ffd7ff255|A| +0#875f87255&@3|║+0#0000001&| +0#0000000#ffffff0@6
+|a|b|c|d|e|f|g|h|i|j|k|╚+0#0000001#ffd7ff255|═@4|╝|s+0#0000000#ffffff0|t|u|v|w|x|y
|z| @23
|@+0#4040ff13&@2| @21
| +0#0000000&@12|1|,|1| @4|T|o|p|
--- /dev/null
+>X+0&#ffffff0| @2|X| @2|X| @2|X| @2|X| @42
+|X| |P+0#ffffff16#5f5fff255|o|p|u|p| +0#000087255&|X| @2|X+0#0000000#ffffff0| @2|X| @42
+|X| | +0#000087255#5f5fff255@1|X| @2|X| @2|X+0#0000000#ffffff0| @2|X| @42
+|X| @2|X| @2|X| @2|X| @2|X| @42
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+| +0#0000000&@41|1|,|1| @10|A|l@1|
--- /dev/null
+>X+0&#ffffff0| @2|X| @2|X| @2|X| @2|X| @42
+|X| |P+0#ffffff16#000087255|o|p|u|p| +0#5f5fff255&|X| @2|X+0#0000000#ffffff0| @2|X| @42
+|X| | +0#5f5fff255#000087255@1|X| @2|X| @2|X+0#0000000#ffffff0| @2|X| @42
+|X| @2|X| @2|X| @2|X| @2|X| @42
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+| +0#0000000&@41|1|,|1| @10|A|l@1|
--- /dev/null
+>X+0#000000255#ffd7af255| @2|X| @2|X| @2|X| @2|X| @42
+|X| |P+0f5fd7255|o|p|u|p| +0#000087255&|X| @2|X+0#000000255#ffd7af255| @2|X| @42
+|X| | +0#000087255#5f5fd7255@1|X| @2|X| @2|X+0#000000255#ffd7af255| @2|X| @42
+|X| @2|X| @2|X| @2|X| @2|X| @42
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+| +0#000000255&@41|1|,|1| @10|A|l@1|
--- /dev/null
+>X+0#000000255#ffdab9255| @2|X| @2|X| @2|X| @2|X| @42
+|X| |P+0ᨁe3255|o|p|u|p| +0#000099255&|X| @2|X+0#000000255#ffdab9255| @2|X| @42
+|X| | +0#000099255#6657e3255@1|X| @2|X| @2|X+0#000000255#ffdab9255| @2|X| @42
+|X| @2|X| @2|X| @2|X| @2|X| @42
+|~+0#0000ff255&| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+| +0#000000255&@41|1|,|1| @10|A|l@1|
>1+0&#ffffff0| @73
|2| @73
-|3| @7|f+0#ff404010#5fafd7255|o@1| +0#87d7ff255&@1|b+0#ffffff16&|a|r| +0#0000000#ffffff0@57
-|4| @7|b+0#ffffff16#5fafd7255|a|z| +0#87d7ff255&@4| +0#0000000#ffffff0@57
+|3| @7|f+0#ff404010#87d7ff255|o@1| +0#5fafd7255&@1|b+0#ffffff16&|a|r| +0#0000000#ffffff0@57
+|4| @7|b+0#ffffff16#87d7ff255|a|z| +0#5fafd7255&@4| +0#0000000#ffffff0@57
|5| @73
|6| @73
|7| @73
->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
+>a+0&#ffffff0@2| |b@2| |c|P+0#e5e9f0255#a9abb1255|O|P|U|P|d+0#04060c255&|C+0#e5e9f0255&|O|N|T|E|N|T|f+0#04060c255&| |g@2| |h@2| @7| +0#0000000#ffffff0@10
+|i@2| |j@2| |k|k+0#04060c255#a9abb1255@1| |l@2| |m@2| |n@2| |o@2| |p@2| @7| +0#0000000#ffffff0@10
+|q@2| |r@2| |s|s+0#04060c255#a9abb1255@1| |m+0#e5e9f0255&|i|d@1|l|e|u+0#04060c255&| |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
>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#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| |o+0#ffffff255#7f7fc5255|p|a|c|i|t|y|x+0#000046255&|o+0#ffffff255&|v|e|r||+1#000046255&|v+0#ffffff255&|s|p|l|i|t|i+0#000046255&|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
|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#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| |o+0#ffffff255#7f7fc5255|p|a|c|i|t|y|x+0#000046255&|o+0#ffffff255&|v|e|r||+1#000046255&|v+0#ffffff255&|s|p|l|i|t|i+0#000046255&|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
->い*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
+>い*0&#ffffff0|え*0#600000255#df7f7f255|ー@6| +&| +0#0000000#ffffff0|ー*&@7|い|!+&| |1| @3
+|い*&| +0#600000255#df7f7f255|カ*0#ffffff255&|ラ|フ|ル|な| +0#600000255&|ー*&@1| +&| +0#0000000#ffffff0|ー*&@7|い|!+&| |2| @3
+|い*&| +0#600000255#df7f7f255|ポ*0#ffffff255#a03f6f255|ッ|プ|ア|ッ|プ|で|─+0#df7f7f255&|╮| +0#0000000#ffffff0|ー*&@7|い|!+&| |3| @3
+|い*&| +0#600000255#df7f7f255|最*0#ffffff255#a03f6f255|上|川| +0#df7f7f255&|ぼ*&|赤|い|な|│+&| +0#0000000#ffffff0|ー*&@7|い|!+&| |4| @3
+|い*&| +0#600000255#df7f7f255|│+0#df7f7f255#a03f6f255|あ*&|い|う|え|お|ー*0#600030255&@1|│+0#df7f7f255&| +0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
+|い*&| +&|│+0#ffffff255#7f7fdf255|ー*0#000060255&@6|│+0#ffffff255&| +0#0000000#ffffff0|ー*&@7|い|!+&| |6| @3
+|い*&| +&|╰+0#ffffff255#7f7fdf255|─@13|╯| +0#0000000#ffffff0|ー*&@7|い|!+&| |7| @3
|い*&|え|ー@15|い|!+&| |8| @3
|い*&|え|ー@15|い|!+&| |9| @3
|い*&|え|ー@15|い|!+&| |1|0| @2
>い*0&#ffffff0|え|ー@15|い|!+&| |1| @3
|い*&|え|ー@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#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
+|い*&| +&|╭+0#ffffff255#7f7fdf255|─@13|╮| +0#0000000#ffffff0|ー*&@7|い|!+&| |3| @3
+|い*&| +&|│+0#ffffff255#7f7fdf255|あ*&|め|ん|ぼ|赤|い|な|│+&| +0#0000000#ffffff0|ー*&@7|い|!+&| |4| @3
+|い*&| +&|│+0#ffffff255#7f7fdf255|あ*&|い|う|え|お|ー*0#000060255&@1|│+0#ffffff255&| +0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3
+|い*&| +&|│+0#ffffff255#7f7fdf255|ー*0#000060255&@4| +&| +0#600030255#a03f6f255|ー*&|│+0#df7f7f255&| +0#600000255#df7f7f255|ー*&@5|ー*0#0000000#ffffff0@1|い|!+&| |6| @3
+|い*&| +&|╰+0#ffffff255#7f7fdf255|─@10|─+0#df7f7f255#a03f6f255|カ*0#ffffff255&|ラ*0&#df7f7f255|フ|ル|な|ー*0#600000255&@2|ー*0#0000000#ffffff0@1|い|!+&| |7| @3
+|い*&|え|ー@4| +&| +0#600000255#df7f7f255|ポ*0#ffffff255&|ッ|プ|ア|ッ|プ|で|ー*0#600000255&|ー*0#0000000#ffffff0@1|い|!+&| |8| @3
+|い*&|え|ー@4| +&| +0#600000255#df7f7f255|最*0#ffffff255&|上|川|ー*0#600000255&@4|ー*0#0000000#ffffff0@1|い|!+&| |9| @3
+|い*&|え|ー@4| +&| +0#600000255#df7f7f255|ー*&@7|ー*0#0000000#ffffff0@1|い|!+&| |1|0| @2
|い*&|え|ー@15|い|!+&| |1@1| @2
|い*&|え|ー@15|い|!+&| |1|2| @2
|い*&|え|ー@15|い|!+&| |1|3| @2
>b+0&#ffffff0|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
-|b|a|c|k|b+0#ffffff16#00005f255|l|u|e|n+0#8787d7255&|p+0#ffffff16&|o|p|u|p|t+0#0000000#ffffff0| |h|e|r|e| @54
-|b|a|c|k|g|r|o|r+0#ffffff16#000000255|e|d| +0#0000000#ffffff0|p+0#ffffff16#000000255|o|p|u|p|h+0#0000000#ffffff0|e|r|e| @54
+|b|a|c|k|b+0#ffffff16#8787d7255|l|u|e|n+0#00005f255&|p+0#ffffff16&|o|p|u|p|t+0#0000000#ffffff0| |h|e|r|e| @54
+|b|a|c|k|g|r|o|r+0#ffffff16#ffffff255|e|d| +0#0000000#ffffff0|p+0#ffffff16#ffffff255|o|p|u|p|h+0#0000000#ffffff0|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
>b+0&#ffffff0|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
-|b|a|c|k|b+0#ffffff16#00005f255|l|u|e|n+0#8787d7255&|p+0#ffffff16&|o|p|u|p|t+0#0000000#ffffff0| |h|e|r|e| @54
-|b|a|c|k|g|r|o|r+0#ffffff16#000000255|e|d| +0#0000000#ffffff0|p+0#ffffff16#000000255|o|p|u|p|h+0#0000000#ffffff0|e|r|e| @54
+|b|a|c|k|b+0#ffffff16#8787d7255|l|u|e|n+0#00005f255&|p+0#ffffff16&|o|p|u|p|t+0#0000000#ffffff0| |h|e|r|e| @54
+|b|a|c|k|g|r|o|r+0#ffffff16#ffffff255|e|d| +0#0000000#ffffff0|p+0#ffffff16#ffffff255|o|p|u|p|h+0#0000000#ffffff0|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|b|a|c|k|g|r|o|u|n|d| |t|e|x|t| |h|e|r|e| @54
|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G|R|O|U|N|D|B|A|C|K|G
|R|O|U|N|D| @69
|h|e|l@1|o> @69
-|h+0#0000001#5f5f5f255|e|l@1|o| +0#5f5fd7255&@9| +0#4040ff13#ffffff0@59
-|h+0#0000001#875f87255|e|l|p| +0#875fff255&@10| +0#4040ff13#ffffff0@59
+|h+0#0000001#dadada255|e|l@1|o| +0#5f5fd7255&@9| +0#4040ff13#ffffff0@59
+|h+0#0000001#ffd7ff255|e|l|p| +0#875fff255&@10| +0#4040ff13#ffffff0@59
|~| @73
|~| @73
|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@33
|ほ*0&#ffffff0|げ> +&@70
-|ほ*0#0000001#875f00255|げ|ほ*0#ffd787255&|げ|ほ|げ|漢*4#ff875f255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
-|ふ*0#ffffff16#00005f255|が|漢|字|ほ*0#87afaf255&|げ|漢*4#875faf255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
-|カ*0#ffffff16#00005f255|タ|カ|ナ|候|補|漢*4#875faf255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
+|ほ*0#0000001#ffd787255|げ|ほ*0#875f00255&|げ|ほ|げ|漢*4#ff875f255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
+|ふ*0#ffffff16#87afaf255|が|漢|字|ほ*0#00005f255&|げ|漢*4#875faf255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
+|カ*0#ffffff16#87afaf255|タ|カ|ナ|候|補|漢*4#875faf255&| +&| +4#e000e06#ffffff0|テ*&|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
|p+0&#ffffff0|o|p|u|p|-|i|t|e|m|-|1> @62
-|p+0#000000255#5f5f5f255|o|p|u|p|-|i|t|e|m|-|1|d+0#dedede255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
-|p+0#000000255#7f457f255|o|p|u|p|-|i|t|e|m|-|2|d+0#ffc5ff255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
-|p+0#000000255#7f457f255|o|p|u|p|-|i|t|e|m|-|3|d+0#ffc5ff255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
+|p+0#000000255#dedede255|o|p|u|p|-|i|t|e|m|-|1|d+0#5f5f5f255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
+|p+0#000000255#ffc5ff255|o|p|u|p|-|i|t|e|m|-|2|d+0#804680255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
+|p+0#000000255#ffc5ff255|o|p|u|p|-|i|t|e|m|-|3|d+0#804680255&@2| +0#0000000#ffffff0|e@2| |f@2| |g@2| |h@2| @43
|a@2| |b@2| |c@2| |d@2| |e@2| |f@2| |g@2| |h@2| @43
|a@2| |b@2| |c@2| |d@2| |e@2| |f@2| |g@2| |h@2| @43
|a@2| |b@2| |c@2| |d@2| |e@2| |f@2| |g@2| |h@2| @43
|ほ*0&#ffffff0|げ> +&@70
|╭+0#0000001#ffd7ff255|─@15|╮|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|│+0#0000001#ffd7ff255| +0f5f5f255|ほ*&|げ|げ*0#dadada255&|ほ|げ|漢|字| +&|│+0#0000001#ffd7ff255|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|│+0#0000001#ffd7ff255| +0ͫf87255|ふ*&|が|漢|字|げ*0#ffd7ff255&|漢|字| +&|│+0#0000001#ffd7ff255|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|│+0#0000001#ffd7ff255| +0ͫf87255|カ*&|タ|カ|ナ|候|補|字*0#ffd7ff255&| +&|│+0#0000001#ffd7ff255|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
+|│+0#0000001#ffd7ff255| +0&#dadada255|ほ*&|げ|げ*0#5f5f5f255&|ほ|げ|漢|字| +&|│+0#0000001#ffd7ff255|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
+|│+0#0000001#ffd7ff255| |ふ*&|が|漢|字|げ*0#875f87255&|漢|字| +&|│+0#0000001&|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
+|│+0#0000001#ffd7ff255| |カ*&|タ|カ|ナ|候|補|字*0#875f87255&| +&|│+0#0000001&|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
|╰+0#0000001#ffd7ff255|─@15|╯|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
|ほ*0&#ffffff0|げ> +&@70
|╭+0#0000001#ffd7ff255|─@15|╮|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|│+0#0000001#ffd7ff255| +0f5f5f255|ほ*&|げ| +0#dadada255&|げ*&|ほ|げ|漢|字|│+0#0000001#ffd7ff255| +0#0000000#ffffff0|ス*&|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
-|│+0#0000001#ffd7ff255| +0ͫf87255|ふ*&|が|漢|字|げ*0#ffd7ff255&|漢|字| +&|│+0#0000001#ffd7ff255|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|│+0#0000001#ffd7ff255| +0ͫf87255|カ*&|タ|カ|ナ|候|補| +0#ffd7ff255&|字*&|│+0#0000001#ffd7ff255| +0#0000000#ffffff0|ス*&|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
+|│+0#0000001#ffd7ff255| +0&#dadada255|ほ*&|げ| +0#5f5f5f255&|げ*&|ほ|げ|漢|字|│+0#0000001#ffd7ff255| +0#0000000#ffffff0|ス*&|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
+|│+0#0000001#ffd7ff255| |ふ*&|が|漢|字|げ*0#875f87255&|漢|字| +&|│+0#0000001&|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
+|│+0#0000001#ffd7ff255| |カ*&|タ|カ|ナ|候|補| +0#875f87255&|字*&|│+0#0000001&| +0#0000000#ffffff0|ス*&|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
|╰+0#0000001#ffd7ff255|─@15|╯|ス*0#0000000#ffffff0|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
|a|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
delfunc s:PopupFilter
endfunc
+func Test_popup_opacity_fade_to_background()
+ CheckScreendump
+
+ " Opacity popup spanning a vertical split should redraw both windows
+ " underneath, not just the left one (blend accumulation bug).
+ let lines =<< trim END
+ call setline(1, repeat(['X X X X X'], 4))
+ hi PopupColor guibg=blue
+ let g:pop_id = popup_create(['Popup'], #{
+ \ line: 2, col: 3,
+ \ minwidth: 10,
+ \ minheight: 2,
+ \ highlight: 'PopupColor',
+ \ opacity: 60,
+ \ zindex: 50,
+ \})
+ END
+ call writefile(lines, 'XtestPopupOpacityFadeToBackground', 'D')
+ let buf = RunVimInTerminal('-S XtestPopupOpacityFadeToBackground', #{rows: 12, cols: 60})
+ " light background without Normal color set
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_fade_to_background_1', {})
+
+ " dark background without Normal color set
+ call term_sendkeys(buf, ":set background=dark\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_fade_to_background_2', {})
+
+ " light background with Normal cterm color set
+ call term_sendkeys(buf, ":set background=light\<CR>")
+ call term_sendkeys(buf, ":highlight Normal ctermfg=16 ctermbg=223\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_fade_to_background_3', {})
+
+ " light background with Normal gui color set
+ call term_sendkeys(buf, ":set termguicolors\<CR>")
+ call term_sendkeys(buf, ":highlight Normal ctermfg=NONE ctermbg=NONE guifg=#000000 guibg=#ffdab9\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_fade_to_background_4', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 545,
/**/
544,
/**/