comparison src/term.c @ 14806:7cc2d28778ac v8.1.0415

patch 8.1.0415: not actually using 16 colors with vtp commit https://github.com/vim/vim/commit/d4f73438bb6c88a0d3e315f0eebef30993b5921c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 21 12:24:12 2018 +0200 patch 8.1.0415: not actually using 16 colors with vtp Problem: Not actually using 16 colors with vtp. Solution: Always use 256 colors when vtp is used. (Nobuhiro Takasaki, closes #3432)
author Christian Brabandt <cb@256bit.org>
date Fri, 21 Sep 2018 12:30:06 +0200
parents 193471015e1a
children 27b9a84395b5
comparison
equal deleted inserted replaced
14805:c784720ab1c3 14806:7cc2d28778ac
6741 6741
6742 # ifdef FEAT_TERMGUICOLORS 6742 # ifdef FEAT_TERMGUICOLORS
6743 # define KSSIZE 20 6743 # define KSSIZE 20
6744 struct ks_tbl_s 6744 struct ks_tbl_s
6745 { 6745 {
6746 int code; /* value of KS_ */ 6746 int code; // value of KS_
6747 char *vtp; /* code in vtp mode */ 6747 char *vtp; // code in vtp mode
6748 char *vtp2; /* code in vtp2 mode */ 6748 char *vtp2; // code in vtp2 mode
6749 char buf[KSSIZE]; /* save buffer in non-vtp mode */ 6749 char buf[KSSIZE]; // save buffer in non-vtp mode
6750 char vbuf[KSSIZE]; /* save buffer in vtp mode */ 6750 char vbuf[KSSIZE]; // save buffer in vtp mode
6751 char v2buf[KSSIZE]; /* save buffer in vtp2 mode */ 6751 char v2buf[KSSIZE]; // save buffer in vtp2 mode
6752 char arr[KSSIZE]; /* real buffer */ 6752 char arr[KSSIZE]; // real buffer
6753 }; 6753 };
6754 6754
6755 static struct ks_tbl_s ks_tbl[] = 6755 static struct ks_tbl_s ks_tbl[] =
6756 { 6756 {
6757 {(int)KS_ME, "\033|0m", "\033|0m"}, /* normal */ 6757 {(int)KS_ME, "\033|0m", "\033|0m"}, // normal
6758 {(int)KS_MR, "\033|7m", "\033|7m"}, /* reverse */ 6758 {(int)KS_MR, "\033|7m", "\033|7m"}, // reverse
6759 {(int)KS_MD, "\033|1m", "\033|1m"}, /* bold */ 6759 {(int)KS_MD, "\033|1m", "\033|1m"}, // bold
6760 {(int)KS_SO, "\033|91m", "\033|91m"}, /* standout: bright red text */ 6760 {(int)KS_SO, "\033|91m", "\033|91m"}, // standout: bright red text
6761 {(int)KS_SE, "\033|39m", "\033|39m"}, /* standout end: default color */ 6761 {(int)KS_SE, "\033|39m", "\033|39m"}, // standout end: default color
6762 {(int)KS_CZH, "\033|95m", "\033|95m"}, /* italic: bright magenta text */ 6762 {(int)KS_CZH, "\033|95m", "\033|95m"}, // italic: bright magenta text
6763 {(int)KS_CZR, "\033|0m", "\033|0m"}, /* italic end */ 6763 {(int)KS_CZR, "\033|0m", "\033|0m"}, // italic end
6764 {(int)KS_US, "\033|4m", "\033|4m"}, /* underscore */ 6764 {(int)KS_US, "\033|4m", "\033|4m"}, // underscore
6765 {(int)KS_UE, "\033|24m", "\033|24m"}, /* underscore end */ 6765 {(int)KS_UE, "\033|24m", "\033|24m"}, // underscore end
6766 # ifdef TERMINFO 6766 # ifdef TERMINFO
6767 {(int)KS_CAB, "\033|%p1%db", "\033|%p14%dm"}, /* set background color */ 6767 {(int)KS_CAB, "\033|%p1%db", "\033|%p14%dm"}, // set background color
6768 {(int)KS_CAF, "\033|%p1%df", "\033|%p13%dm"}, /* set foreground color */ 6768 {(int)KS_CAF, "\033|%p1%df", "\033|%p13%dm"}, // set foreground color
6769 # else 6769 # else
6770 {(int)KS_CAB, "\033|%db", "\033|4%dm"}, /* set background color */ 6770 {(int)KS_CAB, "\033|%db", "\033|4%dm"}, // set background color
6771 {(int)KS_CAF, "\033|%df", "\033|3%dm"}, /* set foreground color */ 6771 {(int)KS_CAF, "\033|%df", "\033|3%dm"}, // set foreground color
6772 # endif 6772 # endif
6773 {(int)KS_CCO, "16", "256"}, /* colors */ 6773 {(int)KS_CCO, "256", "256"}, // colors
6774 {(int)KS_NAME} /* terminator */ 6774 {(int)KS_NAME} // terminator
6775 }; 6775 };
6776 6776
6777 static struct builtin_term * 6777 static struct builtin_term *
6778 find_first_tcap( 6778 find_first_tcap(
6779 char_u *name, 6779 char_u *name,