1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Fix utf8 chars in statusbar

This commit is contained in:
James Booth 2018-03-11 00:46:27 +00:00
parent 73b8d07a80
commit 9f24f6083b

View File

@ -358,7 +358,7 @@ _status_bar_draw_tab(StatusBarTab *tab, int pos, int num)
if (show_name) { if (show_name) {
char *display_name = _display_name(tab); char *display_name = _display_name(tab);
mvwprintw(statusbar_win, 0, pos, display_name); mvwprintw(statusbar_win, 0, pos, display_name);
pos += strlen(display_name); pos += utf8_display_len(display_name);
free(display_name); free(display_name);
} }
wattroff(statusbar_win, status_attrs); wattroff(statusbar_win, status_attrs);
@ -479,7 +479,7 @@ _tabs_width(void)
StatusBarTab *tab = g_hash_table_lookup(statusbar->tabs, GINT_TO_POINTER(i)); StatusBarTab *tab = g_hash_table_lookup(statusbar->tabs, GINT_TO_POINTER(i));
if (tab) { if (tab) {
char *display_name = _display_name(tab); char *display_name = _display_name(tab);
width += strlen(display_name); width += utf8_display_len(display_name);
width += 4; width += 4;
free(display_name); free(display_name);
} }
@ -494,7 +494,7 @@ _tabs_width(void)
StatusBarTab *tab = g_hash_table_lookup(statusbar->tabs, GINT_TO_POINTER(i)); StatusBarTab *tab = g_hash_table_lookup(statusbar->tabs, GINT_TO_POINTER(i));
if (tab) { if (tab) {
char *display_name = _display_name(tab); char *display_name = _display_name(tab);
width += strlen(display_name); width += utf8_display_len(display_name);
width += 2; width += 2;
free(display_name); free(display_name);
} }