Mercurial > pidgin
diff console/libgnt/gnttextview.c @ 14397:70f52ff1caec
[gaim-migrate @ 17105]
fix the bug in textview
committer: Tailor Script <tailor@pidgin.im>
| author | Sadrul Habib Chowdhury <imadil@gmail.com> |
|---|---|
| date | Fri, 01 Sep 2006 02:44:46 +0000 |
| parents | 5f3058c7a7df |
| children | 2377498b4698 |
line wrap: on
line diff
--- a/console/libgnt/gnttextview.c Fri Sep 01 02:07:23 2006 +0000 +++ b/console/libgnt/gnttextview.c Fri Sep 01 02:44:46 2006 +0000 @@ -324,8 +324,17 @@ } line = view->list->data; - end = gnt_util_onscreen_width_to_pointer(start, - widget->priv.width - line->length - 1, &len); + if ((end = strchr(start, '\n')) != NULL || + (end = strchr(start, '\r')) != NULL) { + int l = gnt_util_onscreen_width(start, end - 1); + if (l >= widget->priv.width - line->length - 1) { + end = NULL; + } + } + + if (end == NULL) + end = gnt_util_onscreen_width_to_pointer(start, + widget->priv.width - line->length - 1, &len); seg = g_new0(GntTextSegment, 1); seg->start = start - view->string->str;
