From cf0e5a5e8d6b27cd377b594a4342a7b493f815b0 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 15 Sep 2009 08:56:25 +0200 Subject: [PATCH 1/1] Show one-letter words again Looks like QTextBoundaryFinder has a pathological issue with strings of length 1. --- src/qtui/chatlinemodelitem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qtui/chatlinemodelitem.cpp b/src/qtui/chatlinemodelitem.cpp index ea0b44a9..824e9dab 100644 --- a/src/qtui/chatlinemodelitem.cpp +++ b/src/qtui/chatlinemodelitem.cpp @@ -182,8 +182,12 @@ void ChatLineModelItem::computeWrapList() const { line.setNumColumns(length); layout.endLayout(); - while((idx = finder.toNextBoundary()) >= 0 && idx < length) { - idx++; // the boundary is *before* the actual character + while((idx = finder.toNextBoundary()) >= 0 && idx <= length) { + if(idx < length) + idx++; // the boundary is *before* the actual character + + if(idx == oldidx) + continue; word.start = oldidx; int wordend = idx; -- 2.20.1