pretty-print.c (eat_esc_sequence): Swap the foreground and background colors if...

* gcc/pretty-print.c (eat_esc_sequence): Swap the foreground and background
colors if the COMMON_LVB_REVERSE_VIDEO flag is set, and clear it thereafter,
as it only works for DBCS.

From-SVN: r263531
This commit is contained in:
Liu Hao 2018-08-14 10:04:10 +00:00 committed by Jonathan Yong
parent e99c19aae1
commit 5d3083dde2
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2018-08-13 Liu Hao <lh_mouse@126.com>
* pretty-print.c (eat_esc_sequence): Swap the foreground and
background colors if the COMMON_LVB_REVERSE_VIDEO flag is set,
and clear it thereafter, as it only works for DBCS.
2018-08-13 Liu Hao <lh_mouse@126.com>
* pretty-print.c (mingw_ansi_fputs): Do not call _close() on the

View file

@ -640,6 +640,16 @@ sgr_set_it:
{
attrib_add |= sb.wAttributes & ~attrib_rm;
}
if (attrib_add & COMMON_LVB_REVERSE_VIDEO)
{
/* COMMON_LVB_REVERSE_VIDEO is only effective for DBCS.
* Swap foreground and background colors by hand.
*/
attrib_add = (attrib_add & 0xFF00)
| ((attrib_add & 0x00F0) >> 4)
| ((attrib_add & 0x000F) << 4);
attrib_add &= ~COMMON_LVB_REVERSE_VIDEO;
}
SetConsoleTextAttribute (h, attrib_add);
break;
}