diff options
author | fvogel <fvogelnew1@free.fr> | 2016-09-28 15:54:09 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-09-28 15:54:09 (GMT) |
commit | 6f2501809f0c0af439c3249038587dd32fb52593 (patch) | |
tree | b8d76b5216773e511ce852f90d252cf47d564e00 | |
parent | a17940858b04468beb718a5114bcdf8056b4b8f0 (diff) | |
download | tk-6f2501809f0c0af439c3249038587dd32fb52593.zip tk-6f2501809f0c0af439c3249038587dd32fb52593.tar.gz tk-6f2501809f0c0af439c3249038587dd32fb52593.tar.bz2 |
Fixed [1082213fff] - word wrapping should trim excess spaces
-rw-r--r-- | generic/tkTextDisp.c | 12 |
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; |