diff options
author | dkf <dkf@noemail.net> | 2009-08-04 21:46:02 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-08-04 21:46:02 (GMT) |
commit | ec7d8941ce19f05d200b8ddaf177fcb08d33cc8b (patch) | |
tree | db565e5ec87041e2642b76334f286431fe3b2b4a | |
parent | e3cf88a5868c7e0b42a3546387710b5bef841405 (diff) | |
download | tk-ec7d8941ce19f05d200b8ddaf177fcb08d33cc8b.zip tk-ec7d8941ce19f05d200b8ddaf177fcb08d33cc8b.tar.gz tk-ec7d8941ce19f05d200b8ddaf177fcb08d33cc8b.tar.bz2 |
Fix word-wrapping of non-breaking spaces in the text widget to work reliably.
FossilOrigin-Name: e15dfd4cda9c96b0f8e496249085f8f0314bc091
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 4 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2009-08-04 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkTextDisp.c (TkTextCharLayoutProc): Make the line breaking + algorithm (in the word-wrap case) do the right thing with non-breaking + spaces by restricting what we break on to ASCII spaces, which is good + enough for most purposes. + 2009-08-01 Donal K. Fellows <dkf@users.sf.net> * unix/tkUnixWm.c (WmIconphotoCmd): [Bug 2830420]: Assemble the image diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c8c8606..8477739 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.68 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.68.2.1 2009/08/04 21:46:03 dkf Exp $ */ #include "tkInt.h" @@ -7209,7 +7209,7 @@ TkTextCharLayoutProc( } else { for (count = bytesThatFit, p += bytesThatFit - 1; count > 0; count--, p--) { - if (isspace(UCHAR(*p))) { + if (UCHAR(*p) < 0x80 && isspace(UCHAR(*p))) { chunkPtr->breakIndex = count; break; } |