Skip to content

Commit 187147a

Browse files
committed
patch 7.4.1812
Problem: Failure on startup with Athena and Motif. Solution: Check for INVALCOLOR. (Kazunobu Kuriyama)
1 parent 3266c85 commit 187147a

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/syntax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9261,8 +9261,8 @@ set_hl_attr(
92619261
at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
92629262
at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
92639263
# ifdef FEAT_TERMGUICOLORS
9264-
at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_fg);
9265-
at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_bg);
9264+
at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
9265+
at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
92669266
# endif
92679267
sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en);
92689268
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1812,
756758
/**/
757759
1811,
758760
/**/

src/vim.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,14 +1561,23 @@ typedef UINT32_TYPEDEF UINT32_T;
15611561
#ifdef FEAT_GUI
15621562
# ifdef FEAT_TERMGUICOLORS
15631563
# define GUI_FUNCTION(f) (gui.in_use ? gui_##f : termgui_##f)
1564+
# define GUI_FUNCTION2(f, pixel) (gui.in_use \
1565+
? ((pixel) != INVALCOLOR \
1566+
? gui_##f((pixel)) \
1567+
: (long_u)INVALCOLOR) \
1568+
: termgui_##f((pixel)))
15641569
# define USE_24BIT (gui.in_use || p_tgc)
15651570
# else
15661571
# define GUI_FUNCTION(f) gui_##f
1572+
# define GUI_FUNCTION2(f,pixel) ((pixel) != INVALCOLOR \
1573+
? gui_##f((pixel)) \
1574+
: (long_u)INVALCOLOR)
15671575
# define USE_24BIT gui.in_use
15681576
# endif
15691577
#else
15701578
# ifdef FEAT_TERMGUICOLORS
15711579
# define GUI_FUNCTION(f) termgui_##f
1580+
# define GUI_FUNCTION2(f, pixel) termgui_##f((pixel))
15721581
# define USE_24BIT p_tgc
15731582
# endif
15741583
#endif
@@ -1579,6 +1588,7 @@ typedef UINT32_TYPEDEF UINT32_T;
15791588
#endif
15801589
#ifdef GUI_FUNCTION
15811590
# define GUI_MCH_GET_RGB GUI_FUNCTION(mch_get_rgb)
1591+
# define GUI_MCH_GET_RGB2(pixel) GUI_FUNCTION2(mch_get_rgb, (pixel))
15821592
# define GUI_MCH_GET_COLOR GUI_FUNCTION(mch_get_color)
15831593
# define GUI_GET_COLOR GUI_FUNCTION(get_color)
15841594
#endif

0 commit comments

Comments
 (0)