diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-26 16:52:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-26 16:52:49 +0200 |
commit | 759d81549c1340185f0d92524c563bb37697ea88 (patch) | |
tree | 910d6ade5a87da555b5fc89906de272fd5953b2c /src/term.c | |
parent | 07b761a012958ca91fa420f9c86a33675ddca943 (diff) | |
download | vim-git-759d81549c1340185f0d92524c563bb37697ea88.tar.gz |
patch 8.2.0646: t_Co uses the value of $COLORS in the GUIv8.2.0646
Problem: t_Co uses the value of $COLORS in the GUI. (Masato Nishihata)
Solution: Ignore $COLORS for the GUI. (closes #5992)
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/term.c b/src/term.c index ef91b8fac..f5d5dbc6f 100644 --- a/src/term.c +++ b/src/term.c @@ -3122,15 +3122,21 @@ ttest(int pairs) } 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); - env_colors = mch_getenv((char_u *)"COLORS"); - if (env_colors != NULL && isdigit(*env_colors)) +#ifdef FEAT_GUI + if (!gui.in_use) +#endif { - int colors = atoi((char *)env_colors); + env_colors = mch_getenv((char_u *)"COLORS"); + if (env_colors != NULL && isdigit(*env_colors)) + { + int colors = atoi((char *)env_colors); - if (colors != t_colors) - set_color_count(colors); + if (colors != t_colors) + set_color_count(colors); + } } } |