]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0872: popup with opacity does not use the font of the highlight group v9.2.0872
authorHirohito Higashi <h.east.727@gmail.com>
Wed, 29 Jul 2026 18:38:53 +0000 (18:38 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 29 Jul 2026 18:38:53 +0000 (18:38 +0000)
Problem:  When a popup window has an opacity between 0 and 99 the "font"
          item of its highlight group is ignored and the regular font is
          used instead.  The same applies to "ctermfont", and to the
          popup menu when the "opacity:" value of 'pumopt' is used
          (Salman Halim).
Solution: Also take the font from the popup highlight when blending the
          cell attributes (Hirohito Higashi)

fixes:  #20551
closes: #20866

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/highlight.c
src/version.c

index 1b9cbed7c2861e283c0debca8b7784217535639a..4914526fbeaf004daa028ea77066b421eaf890a8 100644 (file)
@@ -3466,14 +3466,18 @@ hl_blend_attr(int char_attr, int popup_attr, int blend, int blend_fg UNUSED)
            else
            {
                // blend_fg=FALSE: popup text is opaque.  Replace the
-               // underlying cell's attribute flags, fg and special
-               // color with the popup's, so the underlying syntax
+               // underlying cell's attribute flags, fg, special color
+               // and font with the popup's, so the underlying syntax
                // highlighting and any decoration (textprop undercurl,
                // ...) do not bleed through.
                new_en.ae_attr = popup_aep->ae_attr;
                // fallback correctly to Normal fg color if fg_color == INVALCOLOR
                new_en.ae_u.gui.fg_color = popup_aep->ae_u.gui.fg_color;
                new_en.ae_u.gui.sp_color = popup_aep->ae_u.gui.sp_color;
+               new_en.ae_u.gui.font = popup_aep->ae_u.gui.font;
+# ifdef FEAT_XFONTSET
+               new_en.ae_u.gui.fontset = popup_aep->ae_u.gui.fontset;
+# endif
            }
            // Blend background color: blend popup bg toward underlying bg
            {
@@ -3547,8 +3551,8 @@ hl_blend_attr(int char_attr, int popup_attr, int blend, int blend_fg UNUSED)
            if (!blend_fg)
            {
                // blend_fg=FALSE: popup text is opaque.  Replace the
-               // underlying cell's attribute flags, fg and underline
-               // color with the popup's, so the underlying syntax
+               // underlying cell's attribute flags, fg, underline color
+               // and font with the popup's, so the underlying syntax
                // highlighting and any decoration (textprop undercurl,
                // ...) do not bleed through.  When the popup has no fg
                // (e.g. "guifg=NONE") fall back to Normal's fg so the
@@ -3564,6 +3568,7 @@ hl_blend_attr(int char_attr, int popup_attr, int blend, int blend_fg UNUSED)
                    // black-ish or white-ish
                    new_en.ae_u.cterm.fg_color = (*p_bg == 'l') ? 1 : 16;
                new_en.ae_u.cterm.ul_color = popup_aep->ae_u.cterm.ul_color;
+               new_en.ae_u.cterm.font = popup_aep->ae_u.cterm.font;
 #ifdef FEAT_TERMGUICOLORS
                new_en.ae_u.cterm.ul_rgb = popup_aep->ae_u.cterm.ul_rgb;
 #endif
index 725d66af7fba6e90f67f9c6a806baf43edba37fc..c7eac10f8f40f2052fbf82b26ab2b6af569a4ede 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    872,
 /**/
     871,
 /**/