Please find attached a patch to allow the use of termguicolors on
windows console builds.
The default windows console doesn't support 24-bit color, but the
ConEmu[1] project does.

Without this patch, enabling termguicolors on a Windows console build
of vim running under ConEmu would generate 24-bit colors, but they
would not be the correct colors.

The problem was that the RGB macro provided by Windows actually
creates BGR values.  This is OK for Windows GVim builds, because the
Windows API expects colors in this format and vim seems set up to
simply pass these colors through to the end platform, but the
termguicolor support requires the color values to actually be encoded
in RGB order.  So instead, we should only use the existing RGB macro
when not building FEAT_GUI.

Regards,
Gabriel Barta

[1] https://conemu.github.io/

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/term.c b/src/term.c
index a9c2c57fd..a76612861 100644
--- a/src/term.c
+++ b/src/term.c
@@ -6069,8 +6069,12 @@ hex_digit(int c)
     guicolor_T
 gui_get_color_cmn(char_u *name)
 {
-    /* On MS-Windows an RGB macro is available and it's different from ours,
-     * but does what is needed. */
+    /* On MS-Windows an RGB macro is available and it produces 0x00bbggrr color
+     * values as used by the MS-Windows GDI api.  It should be used only for
+     * MS-Windows GDI builds. */
+# if defined(RGB) && !defined(FEAT_GUI)
+# undef RGB
+# endif
 # ifndef RGB
 #  define RGB(r, g, b) ((r<<16) | (g<<8) | (b))
 # endif

Raspunde prin e-mail lui