changeset 16283:1298cb5c1f72 v8.1.1146

patch 8.1.1146: in MS-Windows console colors in a terminal window are wrong commit https://github.com/vim/vim/commit/ef8c83c550e2562362c4385f0823e41ae67cfada Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 11 11:40:13 2019 +0200 patch 8.1.1146: in MS-Windows console colors in a terminal window are wrong Problem: In MS-Windows console colors in a terminal window are wrong. Solution: Use the ansi index also for 16 colors. (Ken Takata)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Apr 2019 11:45:05 +0200
parents 27be2971448c
children 93c7e38d74e8
files src/terminal.c src/version.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -2433,8 +2433,8 @@ color2index(VTermColor *color, int fg, i
     if (color->ansi_index != VTERM_ANSI_INDEX_NONE)
     {
 	/* First 16 colors and default: use the ANSI index, because these
-	 * colors can be redefined. */
-	if (t_colors >= 16)
+	 * colors can be redefined, we use the RGB values. */
+	if (t_colors > 256)
 	    return color->ansi_index;
 	switch (color->ansi_index)
 	{
@@ -3604,6 +3604,7 @@ set_vterm_palette(VTerm *vterm, long_u *
     for (; index < 16; index++)
     {
 	VTermColor	color;
+
 	color.red = (unsigned)(rgb[index] >> 16);
 	color.green = (unsigned)(rgb[index] >> 8) & 255;
 	color.blue = (unsigned)rgb[index] & 255;
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1146,
+/**/
     1145,
 /**/
     1144,