comparison src/term.c @ 9027:773d627cac0b v7.4.1799

commit https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 29 22:59:22 2016 +0200 patch 7.4.1799 Problem: 'guicolors' is a confusing option name. Solution: Use 'termguicolors' instead. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Fri, 29 Apr 2016 23:00:07 +0200
parents 0bc1d66dfa2f
children 0a3bc9fdea20
comparison
equal deleted inserted replaced
9026:eea316a77946 9027:773d627cac0b
75 #define BT_EXTRA_KEYS 0x101 75 #define BT_EXTRA_KEYS 0x101
76 76
77 static struct builtin_term *find_builtin_term(char_u *name); 77 static struct builtin_term *find_builtin_term(char_u *name);
78 static void parse_builtin_tcap(char_u *s); 78 static void parse_builtin_tcap(char_u *s);
79 static void term_color(char_u *s, int n); 79 static void term_color(char_u *s, int n);
80 #ifdef FEAT_TERMTRUECOLOR 80 #ifdef FEAT_TERMGUICOLORS
81 static void term_rgb_color(char_u *s, long_u rgb); 81 static void term_rgb_color(char_u *s, long_u rgb);
82 #endif 82 #endif
83 static void gather_termleader(void); 83 static void gather_termleader(void);
84 #ifdef FEAT_TERMRESPONSE 84 #ifdef FEAT_TERMRESPONSE
85 static void req_codes_from_term(void); 85 static void req_codes_from_term(void);
857 {(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")}, 857 {(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
858 # endif 858 # endif
859 {(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")}, 859 {(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
860 {(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")}, 860 {(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
861 {(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")}, 861 {(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")},
862 # ifdef FEAT_TERMTRUECOLOR 862 # ifdef FEAT_TERMGUICOLORS
863 /* These are printf strings, not terminal codes. */ 863 /* These are printf strings, not terminal codes. */
864 {(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")}, 864 {(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
865 {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")}, 865 {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
866 # endif 866 # endif
867 867
1263 */ 1263 */
1264 {(int)KS_NAME, NULL} 1264 {(int)KS_NAME, NULL}
1265 1265
1266 }; /* end of builtin_termcaps */ 1266 }; /* end of builtin_termcaps */
1267 1267
1268 #if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) 1268 #if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
1269 guicolor_T 1269 guicolor_T
1270 termtrue_mch_get_color(char_u *name) 1270 termgui_mch_get_color(char_u *name)
1271 { 1271 {
1272 return gui_get_color_cmn(name); 1272 return gui_get_color_cmn(name);
1273 } 1273 }
1274 1274
1275 guicolor_T 1275 guicolor_T
1276 termtrue_get_color(char_u *name) 1276 termgui_get_color(char_u *name)
1277 { 1277 {
1278 guicolor_T t; 1278 guicolor_T t;
1279 1279
1280 if (*name == NUL) 1280 if (*name == NUL)
1281 return INVALCOLOR; 1281 return INVALCOLOR;
1282 t = termtrue_mch_get_color(name); 1282 t = termgui_mch_get_color(name);
1283 1283
1284 if (t == INVALCOLOR) 1284 if (t == INVALCOLOR)
1285 EMSG2(_("E254: Cannot allocate color %s"), name); 1285 EMSG2(_("E254: Cannot allocate color %s"), name);
1286 return t; 1286 return t;
1287 } 1287 }
1288 1288
1289 long_u 1289 long_u
1290 termtrue_mch_get_rgb(guicolor_T color) 1290 termgui_mch_get_rgb(guicolor_T color)
1291 { 1291 {
1292 return (long_u) color; 1292 return (long_u)color;
1293 } 1293 }
1294 #endif 1294 #endif
1295 1295
1296 /* 1296 /*
1297 * DEFAULT_TERM is used, when no terminal is specified with -T option or $TERM. 1297 * DEFAULT_TERM is used, when no terminal is specified with -T option or $TERM.
2643 } 2643 }
2644 else 2644 else
2645 OUT_STR(tgoto((char *)s, 0, n)); 2645 OUT_STR(tgoto((char *)s, 0, n));
2646 } 2646 }
2647 2647
2648 #if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) 2648 #if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
2649 void 2649 void
2650 term_fg_rgb_color(long_u rgb) 2650 term_fg_rgb_color(long_u rgb)
2651 { 2651 {
2652 term_rgb_color(T_8F, rgb); 2652 term_rgb_color(T_8F, rgb);
2653 } 2653 }
6051 ++p; 6051 ++p;
6052 } 6052 }
6053 } 6053 }
6054 #endif 6054 #endif
6055 6055
6056 #if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) || defined(PROTO) 6056 #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
6057 static int 6057 static int
6058 hex_digit(int c) 6058 hex_digit(int c)
6059 { 6059 {
6060 if (isdigit(c)) 6060 if (isdigit(c))
6061 return c - '0'; 6061 return c - '0';