1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Bug 1061: Correctly truncate UTF-8 titles in the tab bar.

This commit is contained in:
Kalle Olavi Niemitalo 2009-01-01 20:01:50 +00:00 committed by Kalle Olavi Niemitalo
parent 8d19b87cb1
commit e5722ad0d9
2 changed files with 11 additions and 1 deletions

1
NEWS
View File

@ -21,6 +21,7 @@ includes the changes listed under ``ELinks 0.11.5.GIT'' below.
option to disable this. When removing control characters from a
title, note the charset. Don't truncate titles to the width of the
terminal.
* bug 1061: Correctly truncate UTF-8 titles in the tab bar.
* enhancement: Updated ISO 8859-7, ISO 8859-16, KOI8-R, and MacRoman.
ELinks 0.12pre2:

View File

@ -359,7 +359,16 @@ display_tab_bar(struct session *ses, struct terminal *term, int tabs_count)
box.x, box.y, actual_tab_width,
msg, NULL);
} else {
int msglen = int_min(strlen(msg), actual_tab_width);
int msglen;
#ifdef CONFIG_UTF8
if (term->utf8_cp) {
msglen = utf8_step_forward(msg, NULL,
actual_tab_width,
UTF8_STEP_CELLS_FEWER,
NULL) - msg;
} else
#endif /* CONFIG_UTF8 */
msglen = int_min(strlen(msg), actual_tab_width);
draw_text(term, box.x, box.y, msg, msglen, 0, color);
}