Commits

ZyX_I committed 98c1b76

Added support for synIDattr(, 'fg#', 'gui') if &guicolors is enabled

Comments (0)

Files changed (1)

 	return NULL;
     if (modec == 'g')
     {
-# ifdef FEAT_GUI
+# if defined(FEAT_GUI) || defined(FEAT_XTERM_RGB)
+#  ifdef FEAT_GUI
 	/* return font name */
 	if (font)
 	    return HL_TABLE()[id - 1].sg_font_name;
+#  endif
 
 	/* return #RRGGBB form (only possible when GUI is running) */
-	if (gui.in_use && what[2] == '#')
+	if ((
+#  ifdef FEAT_GUI
+		    gui.in_use
+#  endif
+#  if defined(FEAT_GUI) && defined(FEAT_XTERM_RGB)
+		    ||
+#  endif
+#  ifdef FEAT_XTERM_RGB
+		    p_guicolors
+#  endif
+	    ) && what[2] == '#')
 	{
 	    guicolor_T		color;
 	    long_u		rgb;
 	    if (fg)
 		color = HL_TABLE()[id - 1].sg_gui_fg;
 	    else if (sp)
+#  ifdef FEAT_GUI
 		color = HL_TABLE()[id - 1].sg_gui_sp;
+#  else
+		color = INVALCOLOR;
+#  endif
 	    else
 		color = HL_TABLE()[id - 1].sg_gui_bg;
 	    if (color == INVALCOLOR)
 				      (unsigned)rgb & 255);
 	    return buf;
 	}
-#endif
+# endif
 	if (fg)
 	    return (HL_TABLE()[id - 1].sg_gui_fg_name);
 	if (sp)