Mercurial > vim
diff src/os_win32.c @ 6710:43a07fa78155 v7.4.679
updated for version 7.4.679
Problem: Color values greater than 255 cause problems on MS-Windows.
Solution: Truncate to 255 colors. (Yasuhiro Matsumoto)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 24 Mar 2015 17:12:19 +0100 |
parents | f26c1d294156 |
children | 62ba356c2d4e |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -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); }