updated for version 7.4.679 v7.4.679
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Mar 2015 16:12:19 +0000 (17:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Mar 2015 16:12:19 +0000 (17:12 +0100)
Problem:    Color values greater than 255 cause problems on MS-Windows.
Solution:   Truncate to 255 colors. (Yasuhiro Matsumoto)

src/os_win32.c
src/version.c

index f4d43442d85e77647c9990bb75e5cec54b022442..b50ab95eb080bee73ae47fbcf3baee3fd011c259 100644 (file)
@@ -5262,7 +5262,7 @@ gotoxy(
     static void
 textattr(WORD wAttr)
 {
-    g_attrCurrent = wAttr;
+    g_attrCurrent = wAttr & 0xff;
 
     SetConsoleTextAttribute(g_hConOut, wAttr);
 }
@@ -5271,7 +5271,7 @@ textattr(WORD wAttr)
     static void
 textcolor(WORD wAttr)
 {
-    g_attrCurrent = (g_attrCurrent & 0xf0) + wAttr;
+    g_attrCurrent = (g_attrCurrent & 0xf0) + (wAttr & 0x0f);
 
     SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
 }
@@ -5280,7 +5280,7 @@ textcolor(WORD wAttr)
     static void
 textbackground(WORD wAttr)
 {
-    g_attrCurrent = (g_attrCurrent & 0x0f) + (wAttr << 4);
+    g_attrCurrent = (g_attrCurrent & 0x0f) + ((wAttr & 0x0f) << 4);
 
     SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
 }
index ddd8e0453163720263908c324c64c685143775c1..a43522eee6676f165c61f5f259673ff1985f1a30 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    679,
 /**/
     678,
 /**/