Hi Bram and List! 2016-4-25(Mon) 5:03:24 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > I think that 'guicolors' option name does not intuitive. > > This option for terminal, but prefix is 'gui' > > I think it's unnatural. > > > > I propose to rename option name to 'termtruecolor'. (Short name is 'ttc') > > How about this? > > > > NOTE: > > This has been first proposed by Ken Takada. > > > > Patch attached. > > Please check this. > > Yes, I was wondering what users think of when seeing 'guicolors'. The > main thing it does is using the GUI colors for the terminal. Whether > it's actually true colors depends on the terminal. > > So, how about 'termguicolors'? > > Ah, I see Nikolai also suggested this.
Yes, patch update. guicolors --> termguicolors gcol --> tgc termtruecolor --> termguicolors FEAT_TERMTRUECOLOR --> FEAT_TERMGUICOLORS > > NOTE: > > This has been first proposed by Ken Takada. Sorry, It was a mistake. He is Ken Takata. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8310a68..e42116d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3477,18 +3477,6 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. - *'guicolors'* *'gcol'* -'guicolors' 'gcol' boolean (default off) - global - {not in Vi} - {not available when compiled without the - |+termtruecolor| feature} - When on, uses |highlight-guifg| and |highlight-guibg| attributes in - the terminal (thus using 24-bit color). Requires a ISO-8613-3 - compatible terminal. - If setting this option does not work (produces a colorless UI) - reading |xterm-true-color| might help. - *'guicursor'* *'gcr'* *E545* *E546* *E548* *E549* 'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor, ve:ver35-Cursor, @@ -7551,6 +7539,18 @@ A jump table for the options with a short description can be found at |Q_op|. :set encoding=utf-8 < You need to do this when your system has no locale support for UTF-8. + *'termguicolors'* *'tgc'* +'termguicolors' 'tgc' boolean (default off) + global + {not in Vi} + {not available when compiled without the + |+termguicolors| feature} + When on, uses |highlight-guifg| and |highlight-guibg| attributes in + the terminal (thus using 24-bit color). Requires a ISO-8613-3 + compatible terminal. + If setting this option does not work (produces a colorless UI) + reading |xterm-true-color| might help. + *'terse'* *'noterse'* 'terse' boolean (default off) global diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 0ac5b41..69cf5f0 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -426,10 +426,10 @@ Vim has started, the escape sequences may not be recognized anymore. *xterm-true-color* Vim supports using true colors in the terminal (taken from |highlight-guifg| and |highlight-guibg|), given that terminal supports this. To make this -work, 'guicolors' option needs to be set. +work, 'termguicolors' option needs to be set. -Sometimes setting 'guicolors' is not enough and one has to set the |t_8f| and -|t_8b| options explicitly. Default values of these options are +Sometimes setting 'termguicolors' is not enough and one has to set the |t_8f| +and |t_8b| options explicitly. Default values of these options are `^[[38;2;%lu;%lu;%lum` and `^[[48;2;%lu;%lu;%lum` (replace `^[` with real escape) respectively, but it is only set when `$TERM` is `xterm`. Some terminals accept the same sequences, but with all semicolons replaced by diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index b73949f..8565a88 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -424,7 +424,7 @@ m *+tcl* Tcl interface |tcl| m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn| *+terminfo* uses |terminfo| instead of termcap N *+termresponse* support for |t_RV| and |v:termresponse| -m *+termtruecolor* 24-bit color in xterm-compatible terminals support +m *+termguicolors* 24-bit color in xterm-compatible terminals support N *+textobjects* |text-objects| selection *+tgetent* non-Unix only: able to use external termcap N *+timers* the |timer_start()| function diff --git a/runtime/syntax/dircolors.vim b/runtime/syntax/dircolors.vim index c94d720..1b598c3 100644 --- a/runtime/syntax/dircolors.vim +++ b/runtime/syntax/dircolors.vim @@ -44,24 +44,24 @@ highlight default link dircolorsExtension Identifier highlight default link dircolorsEscape Special function! s:set_guicolors() abort - let s:guicolors = {} - - let s:guicolors[0] = "Black" - let s:guicolors[1] = "DarkRed" - let s:guicolors[2] = "DarkGreen" - let s:guicolors[3] = "DarkYellow" - let s:guicolors[4] = "DarkBlue" - let s:guicolors[5] = "DarkMagenta" - let s:guicolors[6] = "DarkCyan" - let s:guicolors[7] = "Gray" - let s:guicolors[8] = "DarkGray" - let s:guicolors[9] = "Red" - let s:guicolors[10] = "Green" - let s:guicolors[11] = "Yellow" - let s:guicolors[12] = "Blue" - let s:guicolors[13] = "Magenta" - let s:guicolors[14] = "Cyan" - let s:guicolors[15] = "White" + let s:termguicolors = {} + + let s:termguicolors[0] = "Black" + let s:termguicolors[1] = "DarkRed" + let s:termguicolors[2] = "DarkGreen" + let s:termguicolors[3] = "DarkYellow" + let s:termguicolors[4] = "DarkBlue" + let s:termguicolors[5] = "DarkMagenta" + let s:termguicolors[6] = "DarkCyan" + let s:termguicolors[7] = "Gray" + let s:termguicolors[8] = "DarkGray" + let s:termguicolors[9] = "Red" + let s:termguicolors[10] = "Green" + let s:termguicolors[11] = "Yellow" + let s:termguicolors[12] = "Blue" + let s:termguicolors[13] = "Magenta" + let s:termguicolors[14] = "Cyan" + let s:termguicolors[15] = "White" let xterm_palette = ["00", "5f", "87", "af", "d7", "ff"] @@ -70,7 +70,7 @@ function! s:set_guicolors() abort for r in xterm_palette for g in xterm_palette for b in xterm_palette - let s:guicolors[cur_col] = '#' . r . g . b + let s:termguicolors[cur_col] = '#' . r . g . b let cur_col += 1 endfor endfor @@ -78,14 +78,14 @@ function! s:set_guicolors() abort for i in range(24) let g = i * 0xa + 8 - let s:guicolors[i + 232] = '#' . g . g . g + let s:termguicolors[i + 232] = '#' . g . g . g endfor endfunction function! s:get_hi_str(color, place) abort if a:color >= 0 && a:color <= 255 if has('gui_running') - return ' gui' . a:place . '=' . s:guicolors[a:color] + return ' gui' . a:place . '=' . s:termguicolors[a:color] elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88 return ' cterm' . a:place . '=' . a:color endif diff --git a/src/eval.c b/src/eval.c index 63ff2a0..d652899 100644 --- a/src/eval.c +++ b/src/eval.c @@ -14042,15 +14042,15 @@ f_has(typval_T *argvars, typval_T *rettv) "tcl", # endif #endif +#ifdef FEAT_TERMGUICOLORS + "termguicolors", +#endif #ifdef TERMINFO "terminfo", #endif #ifdef FEAT_TERMRESPONSE "termresponse", #endif -#ifdef FEAT_TERMTRUECOLOR - "termtruecolor", -#endif #ifdef FEAT_TEXTOBJ "textobjects", #endif @@ -20019,7 +20019,7 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv) } else { -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) modec = 'g'; else diff --git a/src/feature.h b/src/feature.h index d3d768e..54f665f 100644 --- a/src/feature.h +++ b/src/feature.h @@ -815,10 +815,10 @@ #endif /* - * +termtruecolor 'guicolor' option. + * +termguicolors 'termguicolors' option. */ #if (defined(FEAT_BIG) && defined(FEAT_SYN_HL)) && !defined(ALWAYS_USE_GUI) -# define FEAT_TERMTRUECOLOR +# define FEAT_TERMGUICOLORS #endif /* Mac specific thing: Codewarrior interface. */ diff --git a/src/globals.h b/src/globals.h index 8cc9bed..5010cd4 100644 --- a/src/globals.h +++ b/src/globals.h @@ -369,7 +369,7 @@ EXTERN char_u *use_gvimrc INIT(= NULL); /* "-U" cmdline argument */ EXTERN int cterm_normal_fg_color INIT(= 0); EXTERN int cterm_normal_fg_bold INIT(= 0); EXTERN int cterm_normal_bg_color INIT(= 0); -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS EXTERN long_u cterm_normal_fg_gui_color INIT(= INVALCOLOR); EXTERN long_u cterm_normal_bg_gui_color INIT(= INVALCOLOR); #endif diff --git a/src/hardcopy.c b/src/hardcopy.c index aaa2010..55b3b15 100644 --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -307,7 +307,7 @@ prt_get_attr( pattr->underline = (highlight_has_attr(hl_id, HL_UNDERLINE, modec) != NULL); pattr->undercurl = (highlight_has_attr(hl_id, HL_UNDERCURL, modec) != NULL); -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) { bg_color = highlight_gui_color_rgb(hl_id, FALSE); diff --git a/src/option.c b/src/option.c index da02864..d048cec 100644 --- a/src/option.c +++ b/src/option.c @@ -1305,15 +1305,6 @@ static struct vimoption options[] = {(char_u *)NULL, (char_u *)0L} #endif SCRIPTID_INIT}, - {"guicolors", "gcol", P_BOOL|P_VI_DEF|P_VIM|P_RCLR, -#ifdef FEAT_TERMTRUECOLOR - (char_u *)&p_guicolors, PV_NONE, - {(char_u *)FALSE, (char_u *)FALSE} -#else - (char_u*)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)FALSE} -#endif - SCRIPTID_INIT}, {"guicursor", "gcr", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef CURSOR_SHAPE (char_u *)&p_guicursor, PV_NONE, @@ -2625,6 +2616,15 @@ static struct vimoption options[] = {(char_u *)0L, (char_u *)0L} #endif SCRIPTID_INIT}, + {"termguicolors", "tgc", P_BOOL|P_VI_DEF|P_VIM|P_RCLR, +#ifdef FEAT_TERMGUICOLORS + (char_u *)&p_tgc, PV_NONE, + {(char_u *)FALSE, (char_u *)FALSE} +#else + (char_u*)NULL, PV_NONE, + {(char_u *)FALSE, (char_u *)FALSE} +#endif + SCRIPTID_INIT}, {"terse", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_terse, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, @@ -8364,9 +8364,9 @@ set_bool_option( #endif -#ifdef FEAT_TERMTRUECOLOR - /* 'guicolors' */ - else if ((int *)varp == &p_guicolors) +#ifdef FEAT_TERMGUICOLORS + /* 'termguicolors' */ + else if ((int *)varp == &p_tgc) { # ifdef FEAT_GUI if (!gui.in_use && !gui.starting) diff --git a/src/option.h b/src/option.h index 60889ab..6fba8b8 100644 --- a/src/option.h +++ b/src/option.h @@ -527,9 +527,6 @@ EXTERN char_u *p_popt; /* 'printoptions' */ EXTERN char_u *p_header; /* 'printheader' */ #endif EXTERN int p_prompt; /* 'prompt' */ -#ifdef FEAT_TERMTRUECOLOR -EXTERN int p_guicolors; /* 'guicolors' */ -#endif #ifdef FEAT_GUI EXTERN char_u *p_guifont; /* 'guifont' */ # ifdef FEAT_XFONTSET @@ -843,6 +840,9 @@ EXTERN int p_tbidi; /* 'termbidi' */ #ifdef FEAT_MBYTE EXTERN char_u *p_tenc; /* 'termencoding' */ #endif +#ifdef FEAT_TERMGUICOLORS +EXTERN int p_tgc; /* 'termguicolors' */ +#endif EXTERN int p_terse; /* 'terse' */ EXTERN int p_ta; /* 'textauto' */ EXTERN int p_to; /* 'tildeop' */ diff --git a/src/screen.c b/src/screen.c index ee348e9..a72bffa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -7840,12 +7840,12 @@ screen_start_highlight(int attr) if ((attr & HL_BOLD) && T_MD != NULL) /* bold */ out_str(T_MD); else if (aep != NULL && cterm_normal_fg_bold && -#ifdef FEAT_TERMTRUECOLOR - (p_guicolors ? +#ifdef FEAT_TERMGUICOLORS + (p_tgc ? (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR): #endif (t_colors > 1 && aep->ae_u.cterm.fg_color) -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS ) #endif ) @@ -7868,8 +7868,8 @@ screen_start_highlight(int attr) */ if (aep != NULL) { -#ifdef FEAT_TERMTRUECOLOR - if (p_guicolors) +#ifdef FEAT_TERMGUICOLORS + if (p_tgc) { if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR) term_fg_rgb_color(aep->ae_u.cterm.fg_rgb); @@ -7931,13 +7931,13 @@ screen_stop_highlight(void) */ aep = syn_cterm_attr2entry(screen_attr); if (aep != NULL && -#ifdef FEAT_TERMTRUECOLOR - (p_guicolors ? +#ifdef FEAT_TERMGUICOLORS + (p_tgc ? (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR || aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR): #endif (aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color) -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS ) #endif ) @@ -7988,8 +7988,8 @@ screen_stop_highlight(void) if (do_ME || (screen_attr & (HL_BOLD | HL_INVERSE))) out_str(T_ME); -#ifdef FEAT_TERMTRUECOLOR - if (p_guicolors) +#ifdef FEAT_TERMGUICOLORS + if (p_tgc) { if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR) term_fg_rgb_color(cterm_normal_fg_gui_color); @@ -8025,8 +8025,8 @@ reset_cterm_colors(void) if (IS_CTERM) { /* set Normal cterm colors */ -#ifdef FEAT_TERMTRUECOLOR - if (p_guicolors ? +#ifdef FEAT_TERMGUICOLORS + if (p_tgc ? (cterm_normal_fg_gui_color != (long_u)INVALCOLOR || cterm_normal_bg_gui_color != (long_u)INVALCOLOR): (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)) @@ -8959,8 +8959,8 @@ can_clear(char_u *p) #ifdef FEAT_GUI || gui.in_use #endif -#ifdef FEAT_TERMTRUECOLOR - || (p_guicolors && cterm_normal_bg_gui_color != (long_u)INVALCOLOR) +#ifdef FEAT_TERMGUICOLORS + || (p_tgc && cterm_normal_bg_gui_color != (long_u)INVALCOLOR) #endif || cterm_normal_bg_color == 0 || *T_UT != NUL)); } @@ -10293,8 +10293,8 @@ draw_tabline(void) #ifdef FEAT_GUI && !gui.in_use #endif -#ifdef FEAT_TERMTRUECOLOR - && !p_guicolors +#ifdef FEAT_TERMGUICOLORS + && !p_tgc #endif ); diff --git a/src/structs.h b/src/structs.h index 1775256..50901ac 100644 --- a/src/structs.h +++ b/src/structs.h @@ -85,7 +85,7 @@ typedef struct file_buffer buf_T; /* forward declaration */ # include <X11/Intrinsic.h> # endif # define guicolor_T long_u /* avoid error in prototypes and - * make FEAT_TERMTRUECOLOR work */ + * make FEAT_TERMGUICOLORS work */ # define INVALCOLOR ((guicolor_T)0x1ffffff) #endif @@ -913,7 +913,7 @@ typedef struct attr_entry /* These colors need to be > 8 bits to hold 256. */ short_u fg_color; /* foreground color number */ short_u bg_color; /* background color number */ -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS long_u fg_rgb; /* foreground color RGB */ long_u bg_rgb; /* background color RGB */ # endif diff --git a/src/syntax.c b/src/syntax.c index ea4e74c..7d4e7b1 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -34,7 +34,7 @@ struct hl_group int sg_cterm_bg; /* terminal bg color number + 1 */ int sg_cterm_attr; /* Screen attr for color term mode */ /* for when using the GUI */ -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) guicolor_T sg_gui_fg; /* GUI foreground color handle */ guicolor_T sg_gui_bg; /* GUI background color handle */ #endif @@ -99,7 +99,7 @@ static int syn_list_header(int did_header, int outlen, int id); static int hl_has_settings(int idx, int check_link); static void highlight_clear(int idx); -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) static void gui_do_one_color(int idx, int do_menu, int do_tooltip); static guicolor_T color_name2handle(char_u *name); #endif @@ -7337,7 +7337,7 @@ do_highlight( for (idx = 0; idx < highlight_ga.ga_len; ++idx) highlight_clear(idx); init_highlight(TRUE, TRUE); -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) highlight_gui_started(); #endif @@ -7792,14 +7792,14 @@ do_highlight( if (!init) HL_TABLE()[idx].sg_set |= SG_GUI; -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) /* In GUI guifg colors are only used when recognized */ i = color_name2handle(arg); if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 # ifdef FEAT_GUI || !(USE_24BIT) # else - || !p_guicolors + || !p_tgc # endif ) { @@ -7810,7 +7810,7 @@ do_highlight( HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg); else HL_TABLE()[idx].sg_gui_fg_name = NULL; -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 if (is_menu_group) gui.menu_fg_pixel = i; @@ -7835,7 +7835,7 @@ do_highlight( if (!init) HL_TABLE()[idx].sg_set |= SG_GUI; -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) /* In GUI guifg colors are only used when recognized */ i = color_name2handle(arg); if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !USE_24BIT) @@ -7847,7 +7847,7 @@ do_highlight( HL_TABLE()[idx].sg_gui_bg_name = vim_strsave(arg); else HL_TABLE()[idx].sg_gui_bg_name = NULL; -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 if (is_menu_group) gui.menu_bg_pixel = i; @@ -8008,7 +8008,7 @@ do_highlight( * and/or "fg", which have been changed now. */ #endif -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) highlight_gui_started(); #endif @@ -8080,7 +8080,7 @@ restore_cterm_colors(void) cterm_normal_fg_color = 0; cterm_normal_fg_bold = 0; cterm_normal_bg_color = 0; -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS cterm_normal_fg_gui_color = INVALCOLOR; cterm_normal_bg_gui_color = INVALCOLOR; # endif @@ -8134,7 +8134,7 @@ highlight_clear(int idx) vim_free(HL_TABLE()[idx].sg_gui_sp_name); HL_TABLE()[idx].sg_gui_sp_name = NULL; #endif -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) HL_TABLE()[idx].sg_gui_fg = INVALCOLOR; HL_TABLE()[idx].sg_gui_bg = INVALCOLOR; #endif @@ -8158,7 +8158,7 @@ highlight_clear(int idx) #endif } -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) || defined(PROTO) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO) /* * Set the normal foreground and background colors according to the "Normal" * highlighting group. For X11 also set "Menu", "Scrollbar", and @@ -8168,7 +8168,7 @@ highlight_clear(int idx) set_normal_colors(void) { #ifdef FEAT_GUI -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS if (gui.in_use) # endif { @@ -8210,7 +8210,7 @@ set_normal_colors(void) # endif } #endif -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS # ifdef FEAT_GUI else # endif @@ -8473,7 +8473,7 @@ hl_do_font( #endif /* FEAT_GUI */ -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) || defined(PROTO) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO) /* * Return the handle for a color name. * Returns INVALCOLOR when failed. @@ -8486,31 +8486,31 @@ color_name2handle(char_u *name) if (STRICMP(name, "fg") == 0 || STRICMP(name, "foreground") == 0) { -#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) +#if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI) if (gui.in_use) #endif #ifdef FEAT_GUI return gui.norm_pixel; #endif -#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) +#if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI) else #endif -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS return cterm_normal_fg_gui_color; #endif } if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0) { -#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) +#if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI) if (gui.in_use) #endif #ifdef FEAT_GUI return gui.back_pixel; #endif -#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) +#if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI) else #endif -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS return cterm_normal_bg_gui_color; #endif } @@ -8595,7 +8595,7 @@ get_attr_entry(garray_T *table, attrentry_T *aep) == taep->ae_u.cterm.fg_color && aep->ae_u.cterm.bg_color == taep->ae_u.cterm.bg_color -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS && aep->ae_u.cterm.fg_rgb == taep->ae_u.cterm.fg_rgb && aep->ae_u.cterm.bg_rgb @@ -8667,7 +8667,7 @@ get_attr_entry(garray_T *table, attrentry_T *aep) { taep->ae_u.cterm.fg_color = aep->ae_u.cterm.fg_color; taep->ae_u.cterm.bg_color = aep->ae_u.cterm.bg_color; -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS taep->ae_u.cterm.fg_rgb = aep->ae_u.cterm.fg_rgb; taep->ae_u.cterm.bg_rgb = aep->ae_u.cterm.bg_rgb; #endif @@ -8787,7 +8787,7 @@ hl_combine_attr(int char_attr, int prim_attr) new_en.ae_u.cterm.fg_color = spell_aep->ae_u.cterm.fg_color; if (spell_aep->ae_u.cterm.bg_color > 0) new_en.ae_u.cterm.bg_color = spell_aep->ae_u.cterm.bg_color; -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS if (spell_aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR) new_en.ae_u.cterm.fg_rgb = spell_aep->ae_u.cterm.fg_rgb; if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR) @@ -9056,7 +9056,7 @@ highlight_color( return NULL; if (modec == 'g') { -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI /* return font name */ if (font) @@ -9115,7 +9115,7 @@ highlight_color( #endif #if (defined(FEAT_SYN_HL) \ - && (defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR)) \ + && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)) \ && defined(FEAT_PRINTER)) || defined(PROTO) /* * Return color name of highlight group "id" as RGB value. @@ -9255,7 +9255,7 @@ set_hl_attr( * highlighting attributes, need to allocate an attr number. */ if (sgp->sg_cterm_fg == 0 && sgp->sg_cterm_bg == 0 -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS && sgp->sg_gui_fg == INVALCOLOR && sgp->sg_gui_bg == INVALCOLOR # endif @@ -9266,7 +9266,7 @@ set_hl_attr( at_en.ae_attr = sgp->sg_cterm; at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg; at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg; -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_fg); at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_bg); # endif @@ -9420,7 +9420,7 @@ syn_add_group(char_u *name) vim_memset(&(HL_TABLE()[highlight_ga.ga_len]), 0, sizeof(struct hl_group)); HL_TABLE()[highlight_ga.ga_len].sg_name = name; HL_TABLE()[highlight_ga.ga_len].sg_name_u = vim_strsave_up(name); -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) HL_TABLE()[highlight_ga.ga_len].sg_gui_bg = INVALCOLOR; HL_TABLE()[highlight_ga.ga_len].sg_gui_fg = INVALCOLOR; # ifdef FEAT_GUI @@ -9518,7 +9518,7 @@ syn_get_final_id(int hl_id) return hl_id; } -#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) /* * Call this function just after the GUI has started. * It finds the font and color handles for the highlighting groups. @@ -9529,8 +9529,8 @@ highlight_gui_started(void) int idx; /* First get the colors from the "Normal" and "Menu" group, if set */ -# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) -# ifdef FEAT_TERMTRUECOLOR +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) +# ifdef FEAT_TERMGUICOLORS if (USE_24BIT) # endif set_normal_colors(); @@ -9551,7 +9551,7 @@ gui_do_one_color( int didit = FALSE; # ifdef FEAT_GUI -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS if (gui.in_use) # endif if (HL_TABLE()[idx].sg_font_name != NULL) diff --git a/src/term.c b/src/term.c index f662367..0414397 100644 --- a/src/term.c +++ b/src/term.c @@ -77,7 +77,7 @@ struct builtin_term static struct builtin_term *find_builtin_term(char_u *name); static void parse_builtin_tcap(char_u *s); static void term_color(char_u *s, int n); -#ifdef FEAT_TERMTRUECOLOR +#ifdef FEAT_TERMGUICOLORS static void term_rgb_color(char_u *s, long_u rgb); #endif static void gather_termleader(void); @@ -859,7 +859,7 @@ static struct builtin_term builtin_termcaps[] = {(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")}, {(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")}, {(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")}, -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS /* These are printf strings, not terminal codes. */ {(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")}, {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")}, @@ -1265,7 +1265,7 @@ static struct builtin_term builtin_termcaps[] = }; /* end of builtin_termcaps */ -#if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) +#if defined(FEAT_TERMGUICOLORS) || defined(PROTO) # define RGB(r, g, b) ((r<<16) | (g<<8) | (b)) struct rgbcolor_table_S { char_u *color_name; @@ -2780,7 +2780,7 @@ term_color(char_u *s, int n) OUT_STR(tgoto((char *)s, 0, n)); } -#if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) +#if defined(FEAT_TERMGUICOLORS) || defined(PROTO) void term_fg_rgb_color(long_u rgb) { diff --git a/src/version.c b/src/version.c index a5dfd2a..432b9db 100644 --- a/src/version.c +++ b/src/version.c @@ -602,6 +602,11 @@ static char *(features[]) = #else "-tcl", #endif +#ifdef FEAT_TERMGUICOLORS + "+termguicolors", +#else + "-termguicolors", +#endif #if defined(UNIX) || defined(__EMX__) /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */ # ifdef TERMINFO @@ -621,11 +626,6 @@ static char *(features[]) = #else "-termresponse", #endif -#ifdef FEAT_TERMTRUECOLOR - "+termtruecolor", -#else - "-termtruecolor", -#endif #ifdef FEAT_TEXTOBJ "+textobjects", #else diff --git a/src/vim.h b/src/vim.h index f503ebf..567cda1 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1559,21 +1559,21 @@ typedef UINT32_TYPEDEF UINT32_T; #define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a)) #ifdef FEAT_GUI -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS # define GUI_FUNCTION(f) (gui.in_use ? gui_##f : termtrue_##f) -# define USE_24BIT (gui.in_use || p_guicolors) +# define USE_24BIT (gui.in_use || p_tgc) # else # define GUI_FUNCTION(f) gui_##f # define USE_24BIT gui.in_use # endif #else -# ifdef FEAT_TERMTRUECOLOR +# ifdef FEAT_TERMGUICOLORS # define GUI_FUNCTION(f) termtrue_##f -# define USE_24BIT p_guicolors +# define USE_24BIT p_tgc # endif #endif -#ifdef FEAT_TERMTRUECOLOR -# define IS_CTERM (t_colors > 1 || p_guicolors) +#ifdef FEAT_TERMGUICOLORS +# define IS_CTERM (t_colors > 1 || p_tgc) #else # define IS_CTERM (t_colors > 1) #endif