diff src/channel.c @ 20524:bed30e6b5a09 v8.2.0816

patch 8.2.0816: terminal test fails when compiled with Athena Commit: https://github.com/vim/vim/commit/87202264f8e27f084c0e58f98aeb27fa5c6d5251 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 24 17:23:45 2020 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 24 May 2020 17:30:03 +0200
parents 4c317d8c1051
children 5e86e00fa712
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -5308,6 +5308,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		{
 		    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 @@ get_job_options(typval_T *tv, jobopt_T *
 
 		    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);
 		}