mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Use term_add_unichar to print ucs-4 chars.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4812 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
83ad9855e7
commit
e88bd31323
@ -437,7 +437,6 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
|
|
||||||
if (view->utf8) {
|
if (view->utf8) {
|
||||||
chr = read_unichar(text, &end, &char_width);
|
chr = read_unichar(text, &end, &char_width);
|
||||||
end--;
|
|
||||||
} else {
|
} else {
|
||||||
chr = *text;
|
chr = *text;
|
||||||
end = text;
|
end = text;
|
||||||
@ -446,15 +445,17 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
char_width = 2;
|
char_width = 2;
|
||||||
else
|
else
|
||||||
char_width = 1;
|
char_width = 1;
|
||||||
end += char_width-1;
|
end += char_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
xpos += char_width;
|
xpos += char_width;
|
||||||
if (xpos <= term_width) {
|
if (xpos <= term_width) {
|
||||||
if (unichar_isprint(chr)) {
|
if (unichar_isprint(chr)) {
|
||||||
|
if (view->utf8)
|
||||||
|
term_add_unichar(view->window, chr);
|
||||||
|
else
|
||||||
for (; text < end; text++)
|
for (; text < end; text++)
|
||||||
term_addch(view->window, *text);
|
term_addch(view->window, *text);
|
||||||
term_addch(view->window, *text);
|
|
||||||
} else {
|
} else {
|
||||||
/* low-ascii */
|
/* low-ascii */
|
||||||
term_set_color(view->window, ATTR_RESET|ATTR_REVERSE);
|
term_set_color(view->window, ATTR_RESET|ATTR_REVERSE);
|
||||||
@ -462,7 +463,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
term_set_color(view->window, color);
|
term_set_color(view->window, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text++;
|
text = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_clrtoeol && xpos < term_width) {
|
if (need_clrtoeol && xpos < term_width) {
|
||||||
|
Loading…
Reference in New Issue
Block a user