patch 7.4.1799

Problem:    'guicolors' is a confusing option name.
Solution:   Use 'termguicolors' instead. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2016-04-29 22:59:22 +02:00
parent bb82762907
commit 61be73bb0f
17 changed files with 153 additions and 148 deletions

View File

@@ -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 This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons. 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'* *E545* *E546* *E548* *E549*
'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor, 'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor,
ve:ver35-Cursor, 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 :set encoding=utf-8
< You need to do this when your system has no locale support for 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'* *'noterse'*
'terse' boolean (default off) 'terse' boolean (default off)
global global

View File

@@ -1,4 +1,4 @@
*term.txt* For Vim version 7.4. Last change: 2016 Apr 21 *term.txt* For Vim version 7.4. Last change: 2016 Apr 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -302,7 +302,6 @@ Added by Vim (there are no standard codes for these):
t_u7 request cursor position (for xterm) *t_u7* *'t_u7'* t_u7 request cursor position (for xterm) *t_u7* *'t_u7'*
see |'ambiwidth'| see |'ambiwidth'|
t_RB request terminal background color *t_RB* *'t_RB'* t_RB request terminal background color *t_RB* *'t_RB'*
see |'ambiwidth'|
t_8f set foreground color (R, G, B) *t_8f* *'t_8f'* t_8f set foreground color (R, G, B) *t_8f* *'t_8f'*
|xterm-true-color| |xterm-true-color|
t_8b set background color (R, G, B) *t_8b* *'t_8b'* t_8b set background color (R, G, B) *t_8b* *'t_8b'*
@@ -425,19 +424,23 @@ Vim has started, the escape sequences may not be recognized anymore.
*xterm-true-color* *xterm-true-color*
Vim supports using true colors in the terminal (taken from |highlight-guifg| Vim supports using true colors in the terminal (taken from |highlight-guifg|
and |highlight-guibg|), given that terminal supports this. To make this and |highlight-guibg|), given that the terminal supports this. To make this
work, 'guicolors' option needs to be set. work the 'termguicolors' option needs to be set.
Sometimes setting 'guicolors' is not enough and one has to set the |t_8f| and Sometimes setting 'termguicolors' is not enough and one has to set the |t_8f|
|t_8b| options explicitly. Default values of these options are 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 "^[[38;2;%lu;%lu;%lum" and "^[[48;2;%lu;%lu;%lum" respectively, but it is only
escape) respectively, but it is only set when `$TERM` is `xterm`. Some set when `$TERM` is `xterm`. Some terminals accept the same sequences, but
terminals accept the same sequences, but with all semicolons replaced by with all semicolons replaced by colons (this is actually more compatible, but
colons (this is actually more compatible, but less widely supported). These less widely supported): >
options contain printf strings, with |printf()| (actually, its C equivalent set t_8f=^[[38:2:%lu:%lu:%lum
hence `l` modifier) invoked with the t_ option value and three unsigned long set t_8b=^[[48:2:%lu:%lu:%lum
integers that may have any value between 0 and 255 (inclusive) representing (replace `^[` with real escape)
red, green and blue colors respectively.
These options contain printf strings, with |printf()| (actually, its C
equivalent hence `l` modifier) invoked with the t_ option value and three
unsigned long integers that may have any value between 0 and 255 (inclusive)
representing red, green and blue colors respectively.
*xterm-resize* *xterm-resize*
Window resizing with xterm only works if the allowWindowOps resource is Window resizing with xterm only works if the allowWindowOps resource is

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 7.4. Last change: 2016 Mar 20 *various.txt* For Vim version 7.4. Last change: 2016 Apr 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -424,7 +424,7 @@ m *+tcl* Tcl interface |tcl|
m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn| m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn|
*+terminfo* uses |terminfo| instead of termcap *+terminfo* uses |terminfo| instead of termcap
N *+termresponse* support for |t_RV| and |v:termresponse| N *+termresponse* support for |t_RV| and |v:termresponse|
m *+termtruecolor* 24-bit color in xterm-compatible terminals support B *+termguicolors* 24-bit color in xterm-compatible terminals support
N *+textobjects* |text-objects| selection N *+textobjects* |text-objects| selection
*+tgetent* non-Unix only: able to use external termcap *+tgetent* non-Unix only: able to use external termcap
N *+timers* the |timer_start()| function N *+timers* the |timer_start()| function

View File

@@ -44,24 +44,24 @@ highlight default link dircolorsExtension Identifier
highlight default link dircolorsEscape Special highlight default link dircolorsEscape Special
function! s:set_guicolors() abort function! s:set_guicolors() abort
let s:guicolors = {} let s:termguicolors = {}
let s:guicolors[0] = "Black" let s:termguicolors[0] = "Black"
let s:guicolors[1] = "DarkRed" let s:termguicolors[1] = "DarkRed"
let s:guicolors[2] = "DarkGreen" let s:termguicolors[2] = "DarkGreen"
let s:guicolors[3] = "DarkYellow" let s:termguicolors[3] = "DarkYellow"
let s:guicolors[4] = "DarkBlue" let s:termguicolors[4] = "DarkBlue"
let s:guicolors[5] = "DarkMagenta" let s:termguicolors[5] = "DarkMagenta"
let s:guicolors[6] = "DarkCyan" let s:termguicolors[6] = "DarkCyan"
let s:guicolors[7] = "Gray" let s:termguicolors[7] = "Gray"
let s:guicolors[8] = "DarkGray" let s:termguicolors[8] = "DarkGray"
let s:guicolors[9] = "Red" let s:termguicolors[9] = "Red"
let s:guicolors[10] = "Green" let s:termguicolors[10] = "Green"
let s:guicolors[11] = "Yellow" let s:termguicolors[11] = "Yellow"
let s:guicolors[12] = "Blue" let s:termguicolors[12] = "Blue"
let s:guicolors[13] = "Magenta" let s:termguicolors[13] = "Magenta"
let s:guicolors[14] = "Cyan" let s:termguicolors[14] = "Cyan"
let s:guicolors[15] = "White" let s:termguicolors[15] = "White"
let xterm_palette = ["00", "5f", "87", "af", "d7", "ff"] let xterm_palette = ["00", "5f", "87", "af", "d7", "ff"]
@@ -70,7 +70,7 @@ function! s:set_guicolors() abort
for r in xterm_palette for r in xterm_palette
for g in xterm_palette for g in xterm_palette
for b 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 let cur_col += 1
endfor endfor
endfor endfor
@@ -78,14 +78,14 @@ function! s:set_guicolors() abort
for i in range(24) for i in range(24)
let g = i * 0xa + 8 let g = i * 0xa + 8
let s:guicolors[i + 232] = '#' . g . g . g let s:termguicolors[i + 232] = '#' . g . g . g
endfor endfor
endfunction endfunction
function! s:get_hi_str(color, place) abort function! s:get_hi_str(color, place) abort
if a:color >= 0 && a:color <= 255 if a:color >= 0 && a:color <= 255
if has('gui_running') 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 elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88
return ' cterm' . a:place . '=' . a:color return ' cterm' . a:place . '=' . a:color
endif endif

View File

@@ -14042,15 +14042,15 @@ f_has(typval_T *argvars, typval_T *rettv)
"tcl", "tcl",
# endif # endif
#endif #endif
#ifdef FEAT_TERMGUICOLORS
"termguicolors",
#endif
#ifdef TERMINFO #ifdef TERMINFO
"terminfo", "terminfo",
#endif #endif
#ifdef FEAT_TERMRESPONSE #ifdef FEAT_TERMRESPONSE
"termresponse", "termresponse",
#endif #endif
#ifdef FEAT_TERMTRUECOLOR
"termtruecolor",
#endif
#ifdef FEAT_TEXTOBJ #ifdef FEAT_TEXTOBJ
"textobjects", "textobjects",
#endif #endif
@@ -20019,7 +20019,7 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
} }
else else
{ {
#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (USE_24BIT) if (USE_24BIT)
modec = 'g'; modec = 'g';
else else

View File

@@ -815,10 +815,10 @@
#endif #endif
/* /*
* +termtruecolor 'guicolor' option. * +termguicolors 'termguicolors' option.
*/ */
#if (defined(FEAT_BIG) && defined(FEAT_SYN_HL)) && !defined(ALWAYS_USE_GUI) #if (defined(FEAT_BIG) && defined(FEAT_SYN_HL)) && !defined(ALWAYS_USE_GUI)
# define FEAT_TERMTRUECOLOR # define FEAT_TERMGUICOLORS
#endif #endif
/* Mac specific thing: Codewarrior interface. */ /* Mac specific thing: Codewarrior interface. */

View File

@@ -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_color INIT(= 0);
EXTERN int cterm_normal_fg_bold INIT(= 0); EXTERN int cterm_normal_fg_bold INIT(= 0);
EXTERN int cterm_normal_bg_color 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_fg_gui_color INIT(= INVALCOLOR);
EXTERN long_u cterm_normal_bg_gui_color INIT(= INVALCOLOR); EXTERN long_u cterm_normal_bg_gui_color INIT(= INVALCOLOR);
#endif #endif

View File

@@ -307,7 +307,7 @@ prt_get_attr(
pattr->underline = (highlight_has_attr(hl_id, HL_UNDERLINE, modec) != NULL); pattr->underline = (highlight_has_attr(hl_id, HL_UNDERLINE, modec) != NULL);
pattr->undercurl = (highlight_has_attr(hl_id, HL_UNDERCURL, 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) if (USE_24BIT)
{ {
bg_color = highlight_gui_color_rgb(hl_id, FALSE); bg_color = highlight_gui_color_rgb(hl_id, FALSE);

View File

@@ -1303,15 +1303,6 @@ static struct vimoption options[] =
#else #else
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L} {(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 #endif
SCRIPTID_INIT}, SCRIPTID_INIT},
{"guicursor", "gcr", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, {"guicursor", "gcr", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
@@ -2623,6 +2614,15 @@ static struct vimoption options[] =
#else #else
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L} {(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 #endif
SCRIPTID_INIT}, SCRIPTID_INIT},
{"terse", NULL, P_BOOL|P_VI_DEF, {"terse", NULL, P_BOOL|P_VI_DEF,
@@ -8364,9 +8364,9 @@ set_bool_option(
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
/* 'guicolors' */ /* 'termguicolors' */
else if ((int *)varp == &p_guicolors) else if ((int *)varp == &p_tgc)
{ {
# ifdef FEAT_GUI # ifdef FEAT_GUI
if (!gui.in_use && !gui.starting) if (!gui.in_use && !gui.starting)

View File

@@ -527,9 +527,6 @@ EXTERN char_u *p_popt; /* 'printoptions' */
EXTERN char_u *p_header; /* 'printheader' */ EXTERN char_u *p_header; /* 'printheader' */
#endif #endif
EXTERN int p_prompt; /* 'prompt' */ EXTERN int p_prompt; /* 'prompt' */
#ifdef FEAT_TERMTRUECOLOR
EXTERN int p_guicolors; /* 'guicolors' */
#endif
#ifdef FEAT_GUI #ifdef FEAT_GUI
EXTERN char_u *p_guifont; /* 'guifont' */ EXTERN char_u *p_guifont; /* 'guifont' */
# ifdef FEAT_XFONTSET # ifdef FEAT_XFONTSET
@@ -843,6 +840,9 @@ EXTERN int p_tbidi; /* 'termbidi' */
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
EXTERN char_u *p_tenc; /* 'termencoding' */ EXTERN char_u *p_tenc; /* 'termencoding' */
#endif #endif
#ifdef FEAT_TERMGUICOLORS
EXTERN int p_tgc; /* 'termguicolors' */
#endif
EXTERN int p_terse; /* 'terse' */ EXTERN int p_terse; /* 'terse' */
EXTERN int p_ta; /* 'textauto' */ EXTERN int p_ta; /* 'textauto' */
EXTERN int p_to; /* 'tildeop' */ EXTERN int p_to; /* 'tildeop' */

View File

@@ -1,7 +1,7 @@
/* term.c */ /* term.c */
guicolor_T termtrue_mch_get_color(char_u *name); guicolor_T termgui_mch_get_color(char_u *name);
guicolor_T termtrue_get_color(char_u *name); guicolor_T termgui_get_color(char_u *name);
long_u termtrue_mch_get_rgb(guicolor_T color); long_u termgui_mch_get_rgb(guicolor_T color);
int set_termname(char_u *term); int set_termname(char_u *term);
void set_mouse_termcode(int n, char_u *s); void set_mouse_termcode(int n, char_u *s);
void del_mouse_termcode(int n); void del_mouse_termcode(int n);

View File

@@ -7840,12 +7840,12 @@ screen_start_highlight(int attr)
if ((attr & HL_BOLD) && T_MD != NULL) /* bold */ if ((attr & HL_BOLD) && T_MD != NULL) /* bold */
out_str(T_MD); out_str(T_MD);
else if (aep != NULL && cterm_normal_fg_bold && else if (aep != NULL && cterm_normal_fg_bold &&
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
(p_guicolors ? (p_tgc ?
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR): (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR):
#endif #endif
(t_colors > 1 && aep->ae_u.cterm.fg_color) (t_colors > 1 && aep->ae_u.cterm.fg_color)
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
) )
#endif #endif
) )
@@ -7868,8 +7868,8 @@ screen_start_highlight(int attr)
*/ */
if (aep != NULL) if (aep != NULL)
{ {
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
if (p_guicolors) if (p_tgc)
{ {
if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR) if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
term_fg_rgb_color(aep->ae_u.cterm.fg_rgb); term_fg_rgb_color(aep->ae_u.cterm.fg_rgb);
@@ -7931,13 +7931,13 @@ screen_stop_highlight(void)
*/ */
aep = syn_cterm_attr2entry(screen_attr); aep = syn_cterm_attr2entry(screen_attr);
if (aep != NULL && if (aep != NULL &&
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
(p_guicolors ? (p_tgc ?
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR || (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR ||
aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR): aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR):
#endif #endif
(aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color) (aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color)
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
) )
#endif #endif
) )
@@ -7988,8 +7988,8 @@ screen_stop_highlight(void)
if (do_ME || (screen_attr & (HL_BOLD | HL_INVERSE))) if (do_ME || (screen_attr & (HL_BOLD | HL_INVERSE)))
out_str(T_ME); out_str(T_ME);
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
if (p_guicolors) if (p_tgc)
{ {
if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR) if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
term_fg_rgb_color(cterm_normal_fg_gui_color); term_fg_rgb_color(cterm_normal_fg_gui_color);
@@ -8025,8 +8025,8 @@ reset_cterm_colors(void)
if (IS_CTERM) if (IS_CTERM)
{ {
/* set Normal cterm colors */ /* set Normal cterm colors */
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
if (p_guicolors ? if (p_tgc ?
(cterm_normal_fg_gui_color != (long_u)INVALCOLOR (cterm_normal_fg_gui_color != (long_u)INVALCOLOR
|| cterm_normal_bg_gui_color != (long_u)INVALCOLOR): || cterm_normal_bg_gui_color != (long_u)INVALCOLOR):
(cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)) (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0))
@@ -8959,8 +8959,8 @@ can_clear(char_u *p)
#ifdef FEAT_GUI #ifdef FEAT_GUI
|| gui.in_use || gui.in_use
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
|| (p_guicolors && cterm_normal_bg_gui_color != (long_u)INVALCOLOR) || (p_tgc && cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
#endif #endif
|| cterm_normal_bg_color == 0 || *T_UT != NUL)); || cterm_normal_bg_color == 0 || *T_UT != NUL));
} }
@@ -10293,8 +10293,8 @@ draw_tabline(void)
#ifdef FEAT_GUI #ifdef FEAT_GUI
&& !gui.in_use && !gui.in_use
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
&& !p_guicolors && !p_tgc
#endif #endif
); );

View File

@@ -85,7 +85,7 @@ typedef struct file_buffer buf_T; /* forward declaration */
# include <X11/Intrinsic.h> # include <X11/Intrinsic.h>
# endif # endif
# define guicolor_T long_u /* avoid error in prototypes and # define guicolor_T long_u /* avoid error in prototypes and
* make FEAT_TERMTRUECOLOR work */ * make FEAT_TERMGUICOLORS work */
# define INVALCOLOR ((guicolor_T)0x1ffffff) # define INVALCOLOR ((guicolor_T)0x1ffffff)
#endif #endif
@@ -913,7 +913,7 @@ typedef struct attr_entry
/* These colors need to be > 8 bits to hold 256. */ /* These colors need to be > 8 bits to hold 256. */
short_u fg_color; /* foreground color number */ short_u fg_color; /* foreground color number */
short_u bg_color; /* background color number */ short_u bg_color; /* background color number */
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
long_u fg_rgb; /* foreground color RGB */ long_u fg_rgb; /* foreground color RGB */
long_u bg_rgb; /* background color RGB */ long_u bg_rgb; /* background color RGB */
# endif # endif

View File

@@ -34,7 +34,7 @@ struct hl_group
int sg_cterm_bg; /* terminal bg color number + 1 */ int sg_cterm_bg; /* terminal bg color number + 1 */
int sg_cterm_attr; /* Screen attr for color term mode */ int sg_cterm_attr; /* Screen attr for color term mode */
/* for when using the GUI */ /* 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_fg; /* GUI foreground color handle */
guicolor_T sg_gui_bg; /* GUI background color handle */ guicolor_T sg_gui_bg; /* GUI background color handle */
#endif #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 int hl_has_settings(int idx, int check_link);
static void highlight_clear(int idx); 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 void gui_do_one_color(int idx, int do_menu, int do_tooltip);
static guicolor_T color_name2handle(char_u *name); static guicolor_T color_name2handle(char_u *name);
#endif #endif
@@ -7337,7 +7337,7 @@ do_highlight(
for (idx = 0; idx < highlight_ga.ga_len; ++idx) for (idx = 0; idx < highlight_ga.ga_len; ++idx)
highlight_clear(idx); highlight_clear(idx);
init_highlight(TRUE, TRUE); init_highlight(TRUE, TRUE);
#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (USE_24BIT) if (USE_24BIT)
highlight_gui_started(); highlight_gui_started();
#endif #endif
@@ -7792,14 +7792,14 @@ do_highlight(
if (!init) if (!init)
HL_TABLE()[idx].sg_set |= SG_GUI; 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 */ /* In GUI guifg colors are only used when recognized */
i = color_name2handle(arg); i = color_name2handle(arg);
if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0
# ifdef FEAT_GUI # ifdef FEAT_GUI
|| !(USE_24BIT) || !(USE_24BIT)
# else # else
|| !p_guicolors || !p_tgc
# endif # endif
) )
{ {
@@ -7810,7 +7810,7 @@ do_highlight(
HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg); HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg);
else else
HL_TABLE()[idx].sg_gui_fg_name = NULL; 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 # ifdef FEAT_GUI_X11
if (is_menu_group) if (is_menu_group)
gui.menu_fg_pixel = i; gui.menu_fg_pixel = i;
@@ -7835,7 +7835,7 @@ do_highlight(
if (!init) if (!init)
HL_TABLE()[idx].sg_set |= SG_GUI; 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 */ /* In GUI guifg colors are only used when recognized */
i = color_name2handle(arg); i = color_name2handle(arg);
if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !USE_24BIT) 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); HL_TABLE()[idx].sg_gui_bg_name = vim_strsave(arg);
else else
HL_TABLE()[idx].sg_gui_bg_name = NULL; 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 # ifdef FEAT_GUI_X11
if (is_menu_group) if (is_menu_group)
gui.menu_bg_pixel = i; gui.menu_bg_pixel = i;
@@ -8008,7 +8008,7 @@ do_highlight(
* and/or "fg", which have been changed now. * and/or "fg", which have been changed now.
*/ */
#endif #endif
#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (USE_24BIT) if (USE_24BIT)
highlight_gui_started(); highlight_gui_started();
#endif #endif
@@ -8080,7 +8080,7 @@ restore_cterm_colors(void)
cterm_normal_fg_color = 0; cterm_normal_fg_color = 0;
cterm_normal_fg_bold = 0; cterm_normal_fg_bold = 0;
cterm_normal_bg_color = 0; cterm_normal_bg_color = 0;
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
cterm_normal_fg_gui_color = INVALCOLOR; cterm_normal_fg_gui_color = INVALCOLOR;
cterm_normal_bg_gui_color = INVALCOLOR; cterm_normal_bg_gui_color = INVALCOLOR;
# endif # endif
@@ -8134,7 +8134,7 @@ highlight_clear(int idx)
vim_free(HL_TABLE()[idx].sg_gui_sp_name); vim_free(HL_TABLE()[idx].sg_gui_sp_name);
HL_TABLE()[idx].sg_gui_sp_name = NULL; HL_TABLE()[idx].sg_gui_sp_name = NULL;
#endif #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_fg = INVALCOLOR;
HL_TABLE()[idx].sg_gui_bg = INVALCOLOR; HL_TABLE()[idx].sg_gui_bg = INVALCOLOR;
#endif #endif
@@ -8158,7 +8158,7 @@ highlight_clear(int idx)
#endif #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" * Set the normal foreground and background colors according to the "Normal"
* highlighting group. For X11 also set "Menu", "Scrollbar", and * highlighting group. For X11 also set "Menu", "Scrollbar", and
@@ -8168,7 +8168,7 @@ highlight_clear(int idx)
set_normal_colors(void) set_normal_colors(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
if (gui.in_use) if (gui.in_use)
# endif # endif
{ {
@@ -8210,7 +8210,7 @@ set_normal_colors(void)
# endif # endif
} }
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
# ifdef FEAT_GUI # ifdef FEAT_GUI
else else
# endif # endif
@@ -8473,7 +8473,7 @@ hl_do_font(
#endif /* FEAT_GUI */ #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. * Return the handle for a color name.
* Returns INVALCOLOR when failed. * Returns INVALCOLOR when failed.
@@ -8486,31 +8486,31 @@ color_name2handle(char_u *name)
if (STRICMP(name, "fg") == 0 || STRICMP(name, "foreground") == 0) 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) if (gui.in_use)
#endif #endif
#ifdef FEAT_GUI #ifdef FEAT_GUI
return gui.norm_pixel; return gui.norm_pixel;
#endif #endif
#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
else else
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
return cterm_normal_fg_gui_color; return cterm_normal_fg_gui_color;
#endif #endif
} }
if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0) 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) if (gui.in_use)
#endif #endif
#ifdef FEAT_GUI #ifdef FEAT_GUI
return gui.back_pixel; return gui.back_pixel;
#endif #endif
#if defined(FEAT_TERMTRUECOLOR) && defined(FEAT_GUI) #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
else else
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
return cterm_normal_bg_gui_color; return cterm_normal_bg_gui_color;
#endif #endif
} }
@@ -8595,7 +8595,7 @@ get_attr_entry(garray_T *table, attrentry_T *aep)
== taep->ae_u.cterm.fg_color == taep->ae_u.cterm.fg_color
&& aep->ae_u.cterm.bg_color && aep->ae_u.cterm.bg_color
== taep->ae_u.cterm.bg_color == taep->ae_u.cterm.bg_color
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
&& aep->ae_u.cterm.fg_rgb && aep->ae_u.cterm.fg_rgb
== taep->ae_u.cterm.fg_rgb == taep->ae_u.cterm.fg_rgb
&& aep->ae_u.cterm.bg_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.fg_color = aep->ae_u.cterm.fg_color;
taep->ae_u.cterm.bg_color = aep->ae_u.cterm.bg_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.fg_rgb = aep->ae_u.cterm.fg_rgb;
taep->ae_u.cterm.bg_rgb = aep->ae_u.cterm.bg_rgb; taep->ae_u.cterm.bg_rgb = aep->ae_u.cterm.bg_rgb;
#endif #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; new_en.ae_u.cterm.fg_color = spell_aep->ae_u.cterm.fg_color;
if (spell_aep->ae_u.cterm.bg_color > 0) if (spell_aep->ae_u.cterm.bg_color > 0)
new_en.ae_u.cterm.bg_color = spell_aep->ae_u.cterm.bg_color; 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) 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; 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) if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
@@ -9056,7 +9056,7 @@ highlight_color(
return NULL; return NULL;
if (modec == 'g') if (modec == 'g')
{ {
# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
# ifdef FEAT_GUI # ifdef FEAT_GUI
/* return font name */ /* return font name */
if (font) if (font)
@@ -9115,7 +9115,7 @@ highlight_color(
#endif #endif
#if (defined(FEAT_SYN_HL) \ #if (defined(FEAT_SYN_HL) \
&& (defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR)) \ && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)) \
&& defined(FEAT_PRINTER)) || defined(PROTO) && defined(FEAT_PRINTER)) || defined(PROTO)
/* /*
* Return color name of highlight group "id" as RGB value. * 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. * highlighting attributes, need to allocate an attr number.
*/ */
if (sgp->sg_cterm_fg == 0 && sgp->sg_cterm_bg == 0 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_fg == INVALCOLOR
&& sgp->sg_gui_bg == INVALCOLOR && sgp->sg_gui_bg == INVALCOLOR
# endif # endif
@@ -9266,7 +9266,7 @@ set_hl_attr(
at_en.ae_attr = sgp->sg_cterm; at_en.ae_attr = sgp->sg_cterm;
at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg; at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg; 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.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); at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB(sgp->sg_gui_bg);
# endif # endif
@@ -9420,7 +9420,7 @@ syn_add_group(char_u *name)
vim_memset(&(HL_TABLE()[highlight_ga.ga_len]), 0, sizeof(struct hl_group)); 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 = name;
HL_TABLE()[highlight_ga.ga_len].sg_name_u = vim_strsave_up(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_bg = INVALCOLOR;
HL_TABLE()[highlight_ga.ga_len].sg_gui_fg = INVALCOLOR; HL_TABLE()[highlight_ga.ga_len].sg_gui_fg = INVALCOLOR;
# ifdef FEAT_GUI # ifdef FEAT_GUI
@@ -9518,7 +9518,7 @@ syn_get_final_id(int hl_id)
return 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. * Call this function just after the GUI has started.
* It finds the font and color handles for the highlighting groups. * It finds the font and color handles for the highlighting groups.
@@ -9529,8 +9529,8 @@ highlight_gui_started(void)
int idx; int idx;
/* First get the colors from the "Normal" and "Menu" group, if set */ /* First get the colors from the "Normal" and "Menu" group, if set */
# if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
if (USE_24BIT) if (USE_24BIT)
# endif # endif
set_normal_colors(); set_normal_colors();
@@ -9551,7 +9551,7 @@ gui_do_one_color(
int didit = FALSE; int didit = FALSE;
# ifdef FEAT_GUI # ifdef FEAT_GUI
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
if (gui.in_use) if (gui.in_use)
# endif # endif
if (HL_TABLE()[idx].sg_font_name != NULL) if (HL_TABLE()[idx].sg_font_name != NULL)

View File

@@ -77,7 +77,7 @@ struct builtin_term
static struct builtin_term *find_builtin_term(char_u *name); static struct builtin_term *find_builtin_term(char_u *name);
static void parse_builtin_tcap(char_u *s); static void parse_builtin_tcap(char_u *s);
static void term_color(char_u *s, int n); 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); static void term_rgb_color(char_u *s, long_u rgb);
#endif #endif
static void gather_termleader(void); 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_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
{(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")}, {(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
{(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")}, {(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")},
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
/* These are printf strings, not terminal codes. */ /* 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_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")}, {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
@@ -1265,21 +1265,21 @@ static struct builtin_term builtin_termcaps[] =
}; /* end of builtin_termcaps */ }; /* end of builtin_termcaps */
#if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) #if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
guicolor_T guicolor_T
termtrue_mch_get_color(char_u *name) termgui_mch_get_color(char_u *name)
{ {
return gui_get_color_cmn(name); return gui_get_color_cmn(name);
} }
guicolor_T guicolor_T
termtrue_get_color(char_u *name) termgui_get_color(char_u *name)
{ {
guicolor_T t; guicolor_T t;
if (*name == NUL) if (*name == NUL)
return INVALCOLOR; return INVALCOLOR;
t = termtrue_mch_get_color(name); t = termgui_mch_get_color(name);
if (t == INVALCOLOR) if (t == INVALCOLOR)
EMSG2(_("E254: Cannot allocate color %s"), name); EMSG2(_("E254: Cannot allocate color %s"), name);
@@ -1287,9 +1287,9 @@ termtrue_get_color(char_u *name)
} }
long_u long_u
termtrue_mch_get_rgb(guicolor_T color) termgui_mch_get_rgb(guicolor_T color)
{ {
return (long_u) color; return (long_u)color;
} }
#endif #endif
@@ -2645,7 +2645,7 @@ term_color(char_u *s, int n)
OUT_STR(tgoto((char *)s, 0, n)); OUT_STR(tgoto((char *)s, 0, n));
} }
#if defined(FEAT_TERMTRUECOLOR) || defined(PROTO) #if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
void void
term_fg_rgb_color(long_u rgb) term_fg_rgb_color(long_u rgb)
{ {
@@ -6053,7 +6053,7 @@ update_tcap(int attr)
} }
#endif #endif
#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) || defined(PROTO) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
static int static int
hex_digit(int c) hex_digit(int c)
{ {

View File

@@ -602,6 +602,11 @@ static char *(features[]) =
#else #else
"-tcl", "-tcl",
#endif #endif
#ifdef FEAT_TERMGUICOLORS
"+termguicolors",
#else
"-termguicolors",
#endif
#if defined(UNIX) || defined(__EMX__) #if defined(UNIX) || defined(__EMX__)
/* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */ /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
# ifdef TERMINFO # ifdef TERMINFO
@@ -621,11 +626,6 @@ static char *(features[]) =
#else #else
"-termresponse", "-termresponse",
#endif #endif
#ifdef FEAT_TERMTRUECOLOR
"+termtruecolor",
#else
"-termtruecolor",
#endif
#ifdef FEAT_TEXTOBJ #ifdef FEAT_TEXTOBJ
"+textobjects", "+textobjects",
#else #else
@@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1799,
/**/ /**/
1798, 1798,
/**/ /**/

View File

@@ -1559,21 +1559,21 @@ typedef UINT32_TYPEDEF UINT32_T;
#define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a)) #define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a))
#ifdef FEAT_GUI #ifdef FEAT_GUI
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
# define GUI_FUNCTION(f) (gui.in_use ? gui_##f : termtrue_##f) # define GUI_FUNCTION(f) (gui.in_use ? gui_##f : termgui_##f)
# define USE_24BIT (gui.in_use || p_guicolors) # define USE_24BIT (gui.in_use || p_tgc)
# else # else
# define GUI_FUNCTION(f) gui_##f # define GUI_FUNCTION(f) gui_##f
# define USE_24BIT gui.in_use # define USE_24BIT gui.in_use
# endif # endif
#else #else
# ifdef FEAT_TERMTRUECOLOR # ifdef FEAT_TERMGUICOLORS
# define GUI_FUNCTION(f) termtrue_##f # define GUI_FUNCTION(f) termgui_##f
# define USE_24BIT p_guicolors # define USE_24BIT p_tgc
# endif # endif
#endif #endif
#ifdef FEAT_TERMTRUECOLOR #ifdef FEAT_TERMGUICOLORS
# define IS_CTERM (t_colors > 1 || p_guicolors) # define IS_CTERM (t_colors > 1 || p_tgc)
#else #else
# define IS_CTERM (t_colors > 1) # define IS_CTERM (t_colors > 1)
#endif #endif