summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-09-28 15:54:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-09-28 15:54:09 (GMT)
commitc5b90c42e5d068154fabc02c7b294203ced16e97 (patch)
treeb8d76b5216773e511ce852f90d252cf47d564e00 /generic/tkTextDisp.c
parent9fd7a0895dc0c93d3796ad72eccdc631d21f54ac (diff)
downloadtk-c5b90c42e5d068154fabc02c7b294203ced16e97.zip
tk-c5b90c42e5d068154fabc02c7b294203ced16e97.tar.gz
tk-c5b90c42e5d068154fabc02c7b294203ced16e97.tar.bz2
Fixed [1082213fff] - word wrapping should trim excess spaces
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index a135084..892b935 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -7612,6 +7612,18 @@ TkTextCharLayoutProc(
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.
+ */
+
+ bytesThatFit++;
+ }
+ }
if (bytesThatFit == 0) {
#if TK_LAYOUT_WITH_BASE_CHUNKS
chunkPtr->clientData = NULL;