diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-04 20:03:21 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-10 16:05:14 +0100 |
commit | f1cfd6f73f0f5cc16b9b919d64406a35aa81c7cf (patch) | |
tree | 96a6dfbea3772e65aeec1344b2cb4c7061c916ef /src/gui/curses/gui-curses-bar-window.c | |
parent | d18f68e497c4244404ff8f4f50de82717b178e09 (diff) | |
download | weechat-f1cfd6f73f0f5cc16b9b919d64406a35aa81c7cf.zip |
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
Diffstat (limited to 'src/gui/curses/gui-curses-bar-window.c')
-rw-r--r-- | src/gui/curses/gui-curses-bar-window.c | 8 |
1 files changed, 1 insertions, 7 deletions
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; |