From f1cfd6f73f0f5cc16b9b919d64406a35aa81c7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 4 Dec 2022 20:03:21 +0100 Subject: core: do not display non printable chars, fix function utf8_char_size_screen Now the function utf8_char_size_screen can return -1 when the char is not printable. It has a specific behavior for some chars: - U+0009: value of option weechat.look.tab_width - U+0001 to U+001F (except U+0009): 1 - U+00AD (soft hyphen): -1 - U+200B (zero width space): -1 --- src/gui/curses/gui-curses-bar-window.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/gui/curses/gui-curses-bar-window.c') diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 99d64b21b..5d1ea4378 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -361,12 +361,6 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, reverse_video = (gui_window_current_color_attr & A_REVERSE) ? 0 : 1; } - else - { - /* display non printable chars as spaces */ - if (!gui_chat_utf_char_valid (utf_char)) - snprintf (utf_char, sizeof (utf_char), " "); - } while (ptr_char && ptr_char[0]) { @@ -411,8 +405,8 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, *x += size_on_screen; } - ptr_char = utf8_next_char (ptr_char); } + ptr_char = utf8_next_char (ptr_char); } string = utf8_next_char (string); break; -- cgit v1.2.3