Skip to content

Commit fa03fd6

Browse files
committed
patch 7.4.1036
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)
1 parent a330695 commit fa03fd6

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

src/syntax.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7700,7 +7700,7 @@ do_highlight(line, forceit, init)
77007700
color &= 7; /* truncate to 8 colors */
77017701
}
77027702
else if (t_colors == 16 || t_colors == 88
7703-
|| t_colors == 256)
7703+
|| t_colors >= 256)
77047704
{
77057705
/*
77067706
* Guess: if the termcap entry ends in 'm', it is
@@ -7711,19 +7711,16 @@ do_highlight(line, forceit, init)
77117711
p = T_CAF;
77127712
else
77137713
p = T_CSF;
7714-
if (*p != NUL && *(p + STRLEN(p) - 1) == 'm')
7715-
switch (t_colors)
7716-
{
7717-
case 16:
7718-
color = color_numbers_8[i];
7719-
break;
7720-
case 88:
7721-
color = color_numbers_88[i];
7722-
break;
7723-
case 256:
7724-
color = color_numbers_256[i];
7725-
break;
7726-
}
7714+
if (*p != NUL && (t_colors > 256
7715+
|| *(p + STRLEN(p) - 1) == 'm'))
7716+
{
7717+
if (t_colors == 88)
7718+
color = color_numbers_88[i];
7719+
else if (t_colors >= 256)
7720+
color = color_numbers_256[i];
7721+
else
7722+
color = color_numbers_8[i];
7723+
}
77277724
}
77287725
}
77297726
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1036,
744746
/**/
745747
1035,
746748
/**/

0 commit comments

Comments
 (0)