]> granicus.if.org Git - vim/commitdiff
patch 8.1.1146: in MS-Windows console colors in a terminal window are wrong v8.1.1146
authorBram Moolenaar <Bram@vim.org>
Thu, 11 Apr 2019 09:40:13 +0000 (11:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 11 Apr 2019 09:40:13 +0000 (11:40 +0200)
Problem:    In MS-Windows console colors in a terminal window are wrong.
Solution:   Use the ansi index also for 16 colors. (Ken Takata)

src/terminal.c
src/version.c

index 01cabf021f6fcb9a71a929ab0365e3958170d86c..c7dc23f904b75ae4ad2f641442279c0db054aeca 100644 (file)
@@ -2433,8 +2433,8 @@ color2index(VTermColor *color, int fg, int *boldp)
     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 *rgb)
     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;
index 394f89c2789d140be7b6c4c1ca18f6315504831f..cb20b885b36c167b9138246d72aaddba6d4c4c56 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1146,
 /**/
     1145,
 /**/