]> granicus.if.org Git - vim/commitdiff
patch 8.2.0554: the GUI doesn't set t_Co v8.2.0554
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Apr 2020 13:11:06 +0000 (15:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Apr 2020 13:11:06 +0000 (15:11 +0200)
Problem:    The GUI doesn't set t_Co.
Solution:   In the GUI set t_Co to 256 * 256 * 256. (closes #5903)

src/gui.c
src/proto/term.pro
src/term.c
src/testdir/test_gui.vim
src/version.c

index 2d6008146d90ae8cccc83c69bdb5b70b835bf0bb..cdfc929e9f0d6a43ed5932d2532380aed8ded1ff 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -513,6 +513,9 @@ gui_init(void)
         */
        set_option_value((char_u *)"paste", 0L, NULL, 0);
 
+       // Set t_Co to the number of colors: RGB.
+       set_color_count(256 * 256 * 256);
+
        /*
         * Set up system-wide default menus.
         */
index 2091cbfee8ce2d046a5a5e9edaddaa510bdc34ba..4ac2858ab2f3e2236ae0860f17e5e685ed0da2f1 100644 (file)
@@ -1,6 +1,7 @@
 /* term.c */
 guicolor_T termgui_get_color(char_u *name);
 guicolor_T termgui_mch_get_rgb(guicolor_T color);
+void set_color_count(int nr);
 int set_termname(char_u *term);
 void getlinecol(long *cp, long *rp);
 int add_termcap_entry(char_u *name, int force);
index 6afecbae8802825acb3ecb09c6012516d57a952f..ce935dcf4962dc968ec987cd07aad1fb53c0146b 100644 (file)
@@ -1552,7 +1552,7 @@ parse_builtin_tcap(char_u *term)
  * Store it as a number in t_colors.
  * Store it as a string in T_CCO (using nr_colors[]).
  */
-    static void
+    void
 set_color_count(int nr)
 {
     char_u     nr_colors[20];          // string for number of colors
index af4ce246c3fb2224bfb22d83eaeaaad85b8195c0..384209f107cb6c0754a7808099f3282639c89cc7 100644 (file)
@@ -31,6 +31,8 @@ func Test_balloon_show()
 endfunc
 
 func Test_colorscheme()
+  call assert_equal('16777216', &t_Co)
+
   let colorscheme_saved = exists('g:colors_name') ? g:colors_name : 'default'
   let g:color_count = 0
   augroup TestColors
index a9cdd6a8020fd1e5955159f81c38060bf8bbd604..08a95a56d42cffecd4c382de622bda2a4087cca7 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    554,
 /**/
     553,
 /**/