]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1799 v7.4.1799
authorBram Moolenaar <Bram@vim.org>
Fri, 29 Apr 2016 20:59:22 +0000 (22:59 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 29 Apr 2016 20:59:22 +0000 (22:59 +0200)
Problem:    'guicolors' is a confusing option name.
Solution:   Use 'termguicolors' instead. (Hirohito Higashi)

17 files changed:
runtime/doc/options.txt
runtime/doc/term.txt
runtime/doc/various.txt
runtime/syntax/dircolors.vim
src/eval.c
src/feature.h
src/globals.h
src/hardcopy.c
src/option.c
src/option.h
src/proto/term.pro
src/screen.c
src/structs.h
src/syntax.c
src/term.c
src/version.c
src/vim.h

index 8310a68bae664bd6a216440ab07a3d969f1fd354..e42116dc5a79b56735e2043b4a228443a32fd10d 100644 (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
        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
index 0ac5b41b35137e54eb59e38a02408e3e9679c0ac..1eea20f74e0f0e1fe19f05e882ac7c11ada659b1 100644 (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
@@ -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'*
                see |'ambiwidth'|
        t_RB    request terminal background color               *t_RB* *'t_RB'*
-               see |'ambiwidth'|
        t_8f    set foreground color (R, G, B)                  *t_8f* *'t_8f'*
                |xterm-true-color|
        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*
 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.
-
-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
-`^[[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
-colons (this is actually more compatible, but less widely supported). 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.
+and |highlight-guibg|), given that the terminal supports this. To make this 
+work the 'termguicolors' option needs to be set.
+
+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" respectively, but it is only
+set when `$TERM` is `xterm`. Some terminals accept the same sequences, but
+with all semicolons replaced by colons (this is actually more compatible, but
+less widely supported): >
+        set t_8f=^[[38:2:%lu:%lu:%lum
+        set t_8b=^[[48:2:%lu:%lu:%lum
+(replace `^[` with real escape) 
+
+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*
 Window resizing with xterm only works if the allowWindowOps resource is
index b73949f98b2a5ed8fd73252437a3376ea9885d64..1f8e5cd183aecd0a12084b3db5641149903ce132 100644 (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
@@ -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
+B  *+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
index c94d72064470537ea7db3ae71a2d3309bb2e5c49..1b598c39b534e95c8b7aefc066019b3280a9dd00 100644 (file)
@@ -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
index 7abb62be82ad2115260c5dbe9e75d78546aaa39a..b3a3b415a5190aa3533c0795cecded78efa504a4 100644 (file)
@@ -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
index d3d768eb379e982e52548e1f9ef3258359478476..54f665f40ac823aa17c5b3ae418d7c2d46c92747 100644 (file)
 #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. */
index 8cc9bedf9bd81b63a15e8ba874df5a3865ee3b0b..5010cd4aee6a6e9294e6841a417cb89aaf421eb3 100644 (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_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
index aaa20102c8deaa67ac3d9f4d2aadb13604039056..55b3b15241b5fdf8c35e175b286da5895e3c14ba 100644 (file)
@@ -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);
index da0286412313904e83637b1dff99e586a7397c24..d048cecd305099c84a5f99a56181bc67e4de5f5a 100644 (file)
@@ -1303,15 +1303,6 @@ static struct vimoption options[] =
 #else
                            (char_u *)NULL, PV_NONE,
                            {(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,
@@ -2623,6 +2614,15 @@ static struct vimoption options[] =
 #else
                            (char_u *)NULL, PV_NONE,
                            {(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,
@@ -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)
index 60889ab432362269d6cfa3591b9c7936dae90bc7..6fba8b83184d6600078db38ae5cf59783a6c61c8 100644 (file)
@@ -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' */
index 3984515446a3186b16e67821def136035d2431cd..93c6cb09bc645dd1f678072fef4667fde358e259 100644 (file)
@@ -1,7 +1,7 @@
 /* term.c */
-guicolor_T termtrue_mch_get_color(char_u *name);
-guicolor_T termtrue_get_color(char_u *name);
-long_u termtrue_mch_get_rgb(guicolor_T color);
+guicolor_T termgui_mch_get_color(char_u *name);
+guicolor_T termgui_get_color(char_u *name);
+long_u termgui_mch_get_rgb(guicolor_T color);
 int set_termname(char_u *term);
 void set_mouse_termcode(int n, char_u *s);
 void del_mouse_termcode(int n);
index ee348e9b53a25a574d25b4a527d0163973ce7f9e..a72bffa536e5226dc8e935760d9c6c02522d7b5d 100644 (file)
@@ -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
                                            );
 
index 1775256996307641f5b41dfcf5a705c739692875..50901acd5760dfc00acf2866374804282cc16d28 100644 (file)
@@ -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
index ea4e74c66de831c0be484fa898ca0eb712c1a974..7d4e7b1e2f93f10f76aca0e30156c86775361508 100644 (file)
@@ -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)
index 3c8c0fa02b134ce267e5fbc090a0ab91c47be2d1..4af9aeb8465cc193b5d79540571ce0e47895dbe4 100644 (file)
@@ -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,21 +1265,21 @@ static struct builtin_term builtin_termcaps[] =
 
 };     /* end of builtin_termcaps */
 
-#if defined(FEAT_TERMTRUECOLOR) || defined(PROTO)
+#if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
     guicolor_T
-termtrue_mch_get_color(char_u *name)
+termgui_mch_get_color(char_u *name)
 {
     return gui_get_color_cmn(name);
 }
 
     guicolor_T
-termtrue_get_color(char_u *name)
+termgui_get_color(char_u *name)
 {
     guicolor_T t;
 
     if (*name == NUL)
        return INVALCOLOR;
-    t = termtrue_mch_get_color(name);
+    t = termgui_mch_get_color(name);
 
     if (t == INVALCOLOR)
        EMSG2(_("E254: Cannot allocate color %s"), name);
@@ -1287,9 +1287,9 @@ termtrue_get_color(char_u *name)
 }
 
     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
 
@@ -2645,7 +2645,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)
 {
@@ -6053,7 +6053,7 @@ update_tcap(int attr)
 }
 #endif
 
-#if defined(FEAT_GUI) || defined(FEAT_TERMTRUECOLOR) || defined(PROTO)
+#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
     static int
 hex_digit(int c)
 {
index 44f37a7fc64eb4ed6ea023bf4c26a2c53c0a4cea..5a094475dd3cf6fc7ecfc64972a4fb07a3492296 100644 (file)
@@ -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
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1799,
 /**/
     1798,
 /**/
index f503ebf3e499bddc0dd27191d3a3fa8d51cbdde1..5d98a4c127c582016c846e803cebbfb411f59532 100644 (file)
--- 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
-#  define GUI_FUNCTION(f)          (gui.in_use ? gui_##f : termtrue_##f)
-#  define USE_24BIT                (gui.in_use || p_guicolors)
+# ifdef FEAT_TERMGUICOLORS
+#  define GUI_FUNCTION(f)          (gui.in_use ? gui_##f : termgui_##f)
+#  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
-#  define GUI_FUNCTION(f)          termtrue_##f
-#  define USE_24BIT                p_guicolors
+# ifdef FEAT_TERMGUICOLORS
+#  define GUI_FUNCTION(f)          termgui_##f
+#  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