]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1812 v7.4.1812
authorBram Moolenaar <Bram@vim.org>
Sun, 1 May 2016 11:09:57 +0000 (13:09 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 1 May 2016 11:09:57 +0000 (13:09 +0200)
Problem:    Failure on startup with Athena and Motif.
Solution:   Check for INVALCOLOR. (Kazunobu Kuriyama)

src/syntax.c
src/version.c
src/vim.h

index 4e35a6c597a8019a64f994cd57322142f65e48e2..e68090db69a7746abb9806d4c8eb58cc9aa35d9c 100644 (file)
@@ -9261,8 +9261,8 @@ set_hl_attr(
        at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
        at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
 # ifdef FEAT_TERMGUICOLORS
-       at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_fg);
-       at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_bg);
+       at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
+       at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
 # endif
        sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en);
     }
index 714a6d92b1331ea771aa51e92325a31fe69a7da4..75e692d5d628de2ea4ebe6fff270ee2c3a7b43b1 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1812,
 /**/
     1811,
 /**/
index 5d98a4c127c582016c846e803cebbfb411f59532..a5d05a15f828749c056add7229fd60b20056d959 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1561,14 +1561,23 @@ typedef UINT32_TYPEDEF UINT32_T;
 #ifdef FEAT_GUI
 # ifdef FEAT_TERMGUICOLORS
 #  define GUI_FUNCTION(f)          (gui.in_use ? gui_##f : termgui_##f)
+#  define GUI_FUNCTION2(f, pixel)   (gui.in_use \
+                                   ?  ((pixel) != INVALCOLOR \
+                                       ? gui_##f((pixel)) \
+                                       : (long_u)INVALCOLOR) \
+                                   : termgui_##f((pixel)))
 #  define USE_24BIT                (gui.in_use || p_tgc)
 # else
 #  define GUI_FUNCTION(f)          gui_##f
+#  define GUI_FUNCTION2(f,pixel)    ((pixel) != INVALCOLOR \
+                                    ? gui_##f((pixel)) \
+                                    : (long_u)INVALCOLOR)
 #  define USE_24BIT                gui.in_use
 # endif
 #else
 # ifdef FEAT_TERMGUICOLORS
 #  define GUI_FUNCTION(f)          termgui_##f
+#  define GUI_FUNCTION2(f, pixel)   termgui_##f((pixel))
 #  define USE_24BIT                p_tgc
 # endif
 #endif
@@ -1579,6 +1588,7 @@ typedef UINT32_TYPEDEF UINT32_T;
 #endif
 #ifdef GUI_FUNCTION
 # define GUI_MCH_GET_RGB           GUI_FUNCTION(mch_get_rgb)
+# define GUI_MCH_GET_RGB2(pixel)    GUI_FUNCTION2(mch_get_rgb, (pixel))
 # define GUI_MCH_GET_COLOR         GUI_FUNCTION(mch_get_color)
 # define GUI_GET_COLOR             GUI_FUNCTION(get_color)
 #endif