Commit 5d3083dd by Liu Hao Committed by Jonathan Yong

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
parent e99c19aa
2018-08-13 Liu Hao <lh_mouse@126.com> 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 * pretty-print.c (mingw_ansi_fputs): Do not call _close() on the
handle returned by _get_osf_handle(). handle returned by _get_osf_handle().
......
...@@ -640,6 +640,16 @@ sgr_set_it: ...@@ -640,6 +640,16 @@ sgr_set_it:
{ {
attrib_add |= sb.wAttributes & ~attrib_rm; 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); SetConsoleTextAttribute (h, attrib_add);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment