core: add support of reverse video in ANSI color codes
This commit is contained in:
parent
a8ca4b5b3a
commit
177fa6c528
@ -28,6 +28,7 @@ New features::
|
||||
|
||||
Bug fixes::
|
||||
|
||||
* core: add support of reverse video in ANSI color codes
|
||||
* core: fixed segfault during excessive evaluation in function string_repeat (issue #1400)
|
||||
* buflist: fix extra spaces between buffers when conditions are used to hide buffers (regression introduced in version 2.6) (issue #1403)
|
||||
* irc: remove option irc.network.channel_encode, add server option "charset_message" to control which part of the IRC message is decoded/encoded to the target charset (issue #832)
|
||||
|
@ -833,12 +833,18 @@ gui_color_decode_ansi_cb (void *data, const char *text)
|
||||
case 4: /* underline */
|
||||
strcat (output, gui_color_get_custom ("underline"));
|
||||
break;
|
||||
case 7: /* reverse */
|
||||
strcat (output, gui_color_get_custom ("reverse"));
|
||||
break;
|
||||
case 23: /* remove italic */
|
||||
strcat (output, gui_color_get_custom ("-italic"));
|
||||
break;
|
||||
case 24: /* remove underline */
|
||||
strcat (output, gui_color_get_custom ("-underline"));
|
||||
break;
|
||||
case 27: /* remove reverse */
|
||||
strcat (output, gui_color_get_custom ("-reverse"));
|
||||
break;
|
||||
case 30: /* text color */
|
||||
case 31:
|
||||
case 32:
|
||||
|
@ -437,6 +437,15 @@ TEST(GuiColor, ColorDecodeAnsi)
|
||||
WEE_CHECK_DECODE_ANSI(string, "test_\x1B[1mbold\x1B[21m_end", 1);
|
||||
WEE_CHECK_DECODE_ANSI(string, "test_\x1B[1mbold\x1B[22m_end", 1);
|
||||
|
||||
/* reverse */
|
||||
WEE_CHECK_DECODE_ANSI("test_reverse_end",
|
||||
"test_\x1B[7mreverse\x1B[27m_end", 0);
|
||||
snprintf (string, sizeof (string),
|
||||
"test_%sreverse%s_end",
|
||||
gui_color_get_custom ("reverse"),
|
||||
gui_color_get_custom ("-reverse"));
|
||||
WEE_CHECK_DECODE_ANSI(string, "test_\x1B[7mreverse\x1B[27m_end", 1);
|
||||
|
||||
/* italic */
|
||||
WEE_CHECK_DECODE_ANSI("test_italic_end",
|
||||
"test_\x1B[3mitalic\x1B[23m_end", 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user