0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0646: t_Co uses the value of $COLORS in the GUI

Problem:    t_Co uses the value of $COLORS in the GUI. (Masato Nishihata)
Solution:   Ignore $COLORS for the GUI. (closes #5992)
This commit is contained in:
Bram Moolenaar
2020-04-26 16:52:49 +02:00
parent 07b761a012
commit 759d81549c
3 changed files with 15 additions and 12 deletions

View File

@@ -4160,11 +4160,6 @@ set_child_environment(
static char envbuf_Servername[60]; static char envbuf_Servername[60];
# endif # endif
# endif # endif
long colors =
# ifdef FEAT_GUI
gui.in_use ? 256*256*256 :
# endif
t_colors;
# ifdef HAVE_SETENV # ifdef HAVE_SETENV
setenv("TERM", term, 1); setenv("TERM", term, 1);
@@ -4174,7 +4169,7 @@ set_child_environment(
setenv("LINES", (char *)envbuf, 1); setenv("LINES", (char *)envbuf, 1);
sprintf((char *)envbuf, "%ld", columns); sprintf((char *)envbuf, "%ld", columns);
setenv("COLUMNS", (char *)envbuf, 1); setenv("COLUMNS", (char *)envbuf, 1);
sprintf((char *)envbuf, "%ld", colors); sprintf((char *)envbuf, "%d", t_colors);
setenv("COLORS", (char *)envbuf, 1); setenv("COLORS", (char *)envbuf, 1);
# ifdef FEAT_TERMINAL # ifdef FEAT_TERMINAL
if (is_terminal) if (is_terminal)

View File

@@ -3122,8 +3122,13 @@ ttest(int pairs)
} }
need_gather = TRUE; need_gather = TRUE;
// Set t_colors to the value of $COLORS or t_Co. // Set t_colors to the value of $COLORS or t_Co. Ignore $COLORS in the
// GUI.
t_colors = atoi((char *)T_CCO); t_colors = atoi((char *)T_CCO);
#ifdef FEAT_GUI
if (!gui.in_use)
#endif
{
env_colors = mch_getenv((char_u *)"COLORS"); env_colors = mch_getenv((char_u *)"COLORS");
if (env_colors != NULL && isdigit(*env_colors)) if (env_colors != NULL && isdigit(*env_colors))
{ {
@@ -3132,6 +3137,7 @@ ttest(int pairs)
if (colors != t_colors) if (colors != t_colors)
set_color_count(colors); set_color_count(colors);
} }
}
} }
#if (defined(FEAT_GUI) && (defined(FEAT_MENU) || !defined(USE_ON_FLY_SCROLL))) \ #if (defined(FEAT_GUI) && (defined(FEAT_MENU) || !defined(USE_ON_FLY_SCROLL))) \

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
646,
/**/ /**/
645, 645,
/**/ /**/