diff src/vim.h @ 8969:c83e2c1e7f2b v7.4.1770

commit https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 21 21:10:14 2016 +0200 patch 7.4.1770 Problem: Cannot use true color in the terminal. Solution: Add the 'guicolors' option. (Nikolai Pavlov)
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Apr 2016 21:15:07 +0200
parents ed0b39dd7fd6
children 773d627cac0b
line wrap: on
line diff
--- a/src/vim.h
+++ b/src/vim.h
@@ -1558,6 +1558,31 @@ typedef UINT32_TYPEDEF UINT32_T;
 #define MSG_PUTS_LONG(s)	    msg_puts_long_attr((char_u *)(s), 0)
 #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)
+# 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
+# endif
+#endif
+#ifdef FEAT_TERMTRUECOLOR
+# define IS_CTERM		    (t_colors > 1 || p_guicolors)
+#else
+# define IS_CTERM		    (t_colors > 1)
+#endif
+#ifdef GUI_FUNCTION
+# define GUI_MCH_GET_RGB	    GUI_FUNCTION(mch_get_rgb)
+# define GUI_MCH_GET_COLOR	    GUI_FUNCTION(mch_get_color)
+# define GUI_GET_COLOR		    GUI_FUNCTION(get_color)
+#endif
+
 /* Prefer using emsg3(), because perror() may send the output to the wrong
  * destination and mess up the screen. */
 #ifdef HAVE_STRERROR