summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-09-28 19:18:45 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-09-28 19:18:45 (GMT)
commit2ae5179d81bf1d478a7f7baca04997655f0cf425 (patch)
treecd09741dbe0d03bb986a056eae1f3579e7b9d264 /generic/tkTextDisp.c
parentc5b90c42e5d068154fabc02c7b294203ced16e97 (diff)
downloadtk-2ae5179d81bf1d478a7f7baca04997655f0cf425.zip
tk-2ae5179d81bf1d478a7f7baca04997655f0cf425.tar.gz
tk-2ae5179d81bf1d478a7f7baca04997655f0cf425.tar.bz2
Slightly better fix
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c22
1 files 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;