comparison src/syntax.c @ 7467:765110dd332c v7.4.1036

commit https://github.com/vim/vim/commit/fa03fd6c4a9fe05274d62ddefd645cb5801d2023 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 2 22:03:00 2016 +0100 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 https://github.com/vim/vim/issues/504)
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Jan 2016 22:15:04 +0100
parents 8d513ddfe3ec
children ef568437e49a
comparison
equal deleted inserted replaced
7466:dcda98eb7ff1 7467:765110dd332c
7698 HL_TABLE()[idx].sg_cterm &= ~HL_BOLD; 7698 HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
7699 } 7699 }
7700 color &= 7; /* truncate to 8 colors */ 7700 color &= 7; /* truncate to 8 colors */
7701 } 7701 }
7702 else if (t_colors == 16 || t_colors == 88 7702 else if (t_colors == 16 || t_colors == 88
7703 || t_colors == 256) 7703 || t_colors >= 256)
7704 { 7704 {
7705 /* 7705 /*
7706 * Guess: if the termcap entry ends in 'm', it is 7706 * Guess: if the termcap entry ends in 'm', it is
7707 * probably an xterm-like terminal. Use the changed 7707 * probably an xterm-like terminal. Use the changed
7708 * order for colors. 7708 * order for colors.
7709 */ 7709 */
7710 if (*T_CAF != NUL) 7710 if (*T_CAF != NUL)
7711 p = T_CAF; 7711 p = T_CAF;
7712 else 7712 else
7713 p = T_CSF; 7713 p = T_CSF;
7714 if (*p != NUL && *(p + STRLEN(p) - 1) == 'm') 7714 if (*p != NUL && (t_colors > 256
7715 switch (t_colors) 7715 || *(p + STRLEN(p) - 1) == 'm'))
7716 { 7716 {
7717 case 16: 7717 if (t_colors == 88)
7718 color = color_numbers_8[i]; 7718 color = color_numbers_88[i];
7719 break; 7719 else if (t_colors >= 256)
7720 case 88: 7720 color = color_numbers_256[i];
7721 color = color_numbers_88[i]; 7721 else
7722 break; 7722 color = color_numbers_8[i];
7723 case 256: 7723 }
7724 color = color_numbers_256[i];
7725 break;
7726 }
7727 } 7724 }
7728 } 7725 }
7729 } 7726 }
7730 /* Add one to the argument, to avoid zero. Zero is used for 7727 /* Add one to the argument, to avoid zero. Zero is used for
7731 * "NONE", then "color" is -1. */ 7728 * "NONE", then "color" is -1. */