diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-02 22:03:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-02 22:03:00 +0100 |
commit | fa03fd6c4a9fe05274d62ddefd645cb5801d2023 (patch) | |
tree | 6a3e2099d677c218535fcefd471fca858d5e3a22 | |
parent | a3306958dcb9aadff1e1e8521d908d86b10ac99a (diff) | |
download | vim-git-fa03fd6c4a9fe05274d62ddefd645cb5801d2023.tar.gz |
patch 7.4.1036v7.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)
-rw-r--r-- | src/syntax.c | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/syntax.c b/src/syntax.c index a16715a95..ae3a88a61 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -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]; + } } } } diff --git a/src/version.c b/src/version.c index 49eebc12c..48c848529 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1036, +/**/ 1035, /**/ 1034, |