From 2ae5179d81bf1d478a7f7baca04997655f0cf425 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 28 Sep 2016 19:18:45 +0000 Subject: Slightly better fix --- generic/tkTextDisp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 892b935..e3fc5c9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -7604,26 +7604,26 @@ TkTextCharLayoutProc( nextX = maxX; bytesThatFit++; } - if (p[bytesThatFit] == '\n') { - /* - * A newline character takes up no space, so if the previous - * character fits then so does the newline. - */ - - bytesThatFit++; - } if (wrapMode == TEXT_WRAPMODE_WORD) { while (p[bytesThatFit] == ' ') { /* * Space characters that would go at the beginning of the - * next line are allocated to the present line. This gives - * the effect of trimming white spaces at the beginning of - * wrapped lines. + * next line are allocated to the current line. This gives + * the effect of trimming white spaces that would otherwise + * be seen at the beginning of wrapped lines. */ bytesThatFit++; } } + if (p[bytesThatFit] == '\n') { + /* + * A newline character takes up no space, so if the previous + * character fits then so does the newline. + */ + + bytesThatFit++; + } if (bytesThatFit == 0) { #if TK_LAYOUT_WITH_BASE_CHUNKS chunkPtr->clientData = NULL; -- cgit v0.12