patch 8.2.0816: terminal test fails when compiled with Athena
Problem: Terminal test fails when compiled with Athena.
Solution: Do give an error when the GUI is not running. (hint by Dominique
Pelle, closes #5928, closes #6132)
diff --git a/src/channel.c b/src/channel.c
index 68adbc3..2b85ec9 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -5308,6 +5308,7 @@
{
char_u *color_name;
guicolor_T guicolor;
+ int called_emsg_before = called_emsg;
color_name = tv_get_string_chk(&li->li_tv);
if (color_name == NULL)
@@ -5315,7 +5316,12 @@
guicolor = GUI_GET_COLOR(color_name);
if (guicolor == INVALCOLOR)
+ {
+ if (called_emsg_before == called_emsg)
+ // may not get the error if the GUI didn't start
+ semsg(_(e_alloc_color), color_name);
return FAIL;
+ }
rgb[n] = GUI_MCH_GET_RGB(guicolor);
}