]> granicus.if.org Git - vim/commitdiff
patch 7.4.1036 v7.4.1036
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2016 21:03:00 +0000 (22:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2016 21:03:00 +0000 (22:03 +0100)
Problem:    Only terminals with up to 256 colors work properly.
Solution:   Use the 256 color behavior for all terminals with 256 or more
            colors. (Robert de Bath, closes #504)

src/syntax.c
src/version.c

index a16715a9577b3403a24d29692ca69708c3b5e9d7..ae3a88a61ab22ec50947472842138938e3006c99 100644 (file)
@@ -7700,7 +7700,7 @@ do_highlight(line, forceit, init)
                        color &= 7;     /* truncate to 8 colors */
                    }
                    else if (t_colors == 16 || t_colors == 88
-                                                          || t_colors == 256)
+                                                          || t_colors >= 256)
                    {
                        /*
                         * Guess: if the termcap entry ends in 'm', it is
@@ -7711,19 +7711,16 @@ do_highlight(line, forceit, init)
                            p = T_CAF;
                        else
                            p = T_CSF;
-                       if (*p != NUL && *(p + STRLEN(p) - 1) == 'm')
-                           switch (t_colors)
-                           {
-                               case 16:
-                                   color = color_numbers_8[i];
-                                   break;
-                               case 88:
-                                   color = color_numbers_88[i];
-                                   break;
-                               case 256:
-                                   color = color_numbers_256[i];
-                                   break;
-                           }
+                       if (*p != NUL && (t_colors > 256
+                                             || *(p + STRLEN(p) - 1) == 'm'))
+                       {
+                           if (t_colors == 88)
+                               color = color_numbers_88[i];
+                           else if (t_colors >= 256)
+                               color = color_numbers_256[i];
+                           else
+                               color = color_numbers_8[i];
+                       }
                    }
                }
            }
index 49eebc12cca3ee412e8f2f1a6b714772e804b61b..48c848529b6dc50de0071f0b725baa8875c3d192 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1036,
 /**/
     1035,
 /**/