summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-12 15:11:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-12 15:11:06 +0200
commitacc770a10f65107131473ea2ab4ae5d429dfe172 (patch)
tree351cb18e093e7291f67781c233b95f508e93ed21
parentcd630becc8849bf4647f04eeb02a4883bf46140e (diff)
patch 8.2.0554: the GUI doesn't set t_Cov8.2.0554
Problem: The GUI doesn't set t_Co. Solution: In the GUI set t_Co to 256 * 256 * 256. (closes #5903)
-rw-r--r--src/gui.c3
-rw-r--r--src/proto/term.pro1
-rw-r--r--src/term.c2
-rw-r--r--src/testdir/test_gui.vim2
-rw-r--r--src/version.c2
5 files changed, 9 insertions, 1 deletions
diff --git a/src/gui.c b/src/gui.c
index 2d6008146d..cdfc929e9f 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -513,6 +513,9 @@ gui_init(void)
*/
set_option_value((char_u *)"paste", 0L, NULL, 0);
+ // Set t_Co to the number of colors: RGB.
+ set_color_count(256 * 256 * 256);
+
/*
* Set up system-wide default menus.
*/
diff --git a/src/proto/term.pro b/src/proto/term.pro
index 2091cbfee8..4ac2858ab2 100644
--- a/src/proto/term.pro
+++ b/src/proto/term.pro
@@ -1,6 +1,7 @@
/* term.c */
guicolor_T termgui_get_color(char_u *name);
guicolor_T termgui_mch_get_rgb(guicolor_T color);
+void set_color_count(int nr);
int set_termname(char_u *term);
void getlinecol(long *cp, long *rp);
int add_termcap_entry(char_u *name, int force);
diff --git a/src/term.c b/src/term.c
index 6afecbae88..ce935dcf49 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1552,7 +1552,7 @@ parse_builtin_tcap(char_u *term)
* Store it as a number in t_colors.
* Store it as a string in T_CCO (using nr_colors[]).
*/
- static void
+ void
set_color_count(int nr)
{
char_u nr_colors[20]; // string for number of colors
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index af4ce246c3..384209f107 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -31,6 +31,8 @@ func Test_balloon_show()
endfunc
func Test_colorscheme()
+ call assert_equal('16777216', &t_Co)
+
let colorscheme_saved = exists('g:colors_name') ? g:colors_name : 'default'
let g:color_count = 0
augroup TestColors
diff --git a/src/version.c b/src/version.c
index a9cdd6a802..08a95a56d4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 554,
+/**/
553,
/**/
552,