summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-11-08 21:00:48 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-11-08 21:00:48 (GMT)
commit039265e2a240d17e785c3d0d55fa6a108e53f44e (patch)
treeeb585878ca1c7e18de409b8401dfd4f601b95862
parent2028daf50bcb641a8be43c4989a37074d5a00f72 (diff)
parentead20630da62cb8674fea88a385281fd05a0bcd4 (diff)
downloadtk-039265e2a240d17e785c3d0d55fa6a108e53f44e.zip
tk-039265e2a240d17e785c3d0d55fa6a108e53f44e.tar.gz
tk-039265e2a240d17e785c3d0d55fa6a108e53f44e.tar.bz2
Fixed bug [220854fff] - Trailing tab characters in entry widgets are not displayed
-rw-r--r--generic/tkFont.c4
-rw-r--r--tests/entry.test8
-rw-r--r--tests/font.test2
3 files changed, 11 insertions, 3 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 5d2ad43..7ff1ae9 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -2069,14 +2069,14 @@ Tk_ComputeTextLayout(
NewChunk(&layoutPtr, &maxChunks, start, 1, curX, newX,
baseline)->numDisplayChars = -1;
start++;
+ curX = newX;
+ flags &= ~TK_AT_LEAST_ONE;
if ((start < end) &&
((wrapLength <= 0) || (newX <= wrapLength))) {
/*
* More chars can still fit on this line.
*/
- curX = newX;
- flags &= ~TK_AT_LEAST_ONE;
continue;
}
} else {
diff --git a/tests/entry.test b/tests/entry.test
index ffdbf45..27acfc1 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -778,6 +778,14 @@ test entry-6.11 {EntryComputeGeometry procedure} win {
[expr 8+5*[font measure {helvetica 12} .]] \
[expr 8+5*[font measure {helvetica 12} X]] \
[expr 8+[font measure {helvetica 12} 12345]]]
+test entry-6.12 {EntryComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ entry .e -font $fixed -bd 2 -relief raised -width 20
+ pack .e
+ .e insert end "012\t456\t"
+ update
+ list [.e index @81] [.e index @82] [.e index @116] [.e index @117]
+} {6 7 7 8}
catch {destroy .e}
entry .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll
diff --git a/tests/font.test b/tests/font.test
index a02cc2e..9ed24dc 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -829,7 +829,7 @@ test font-24.10 {Tk_ComputeTextLayout: tab caused break} {
lappend x [getsize]
.b.l config -wrap 0
set x
-} "{[expr $ax*3] $ay} {[expr $ax*3] [expr $ay*2]}"
+} "{[expr $ax*8] $ay} {[expr $ax*8] [expr $ay*2]}"
test font-24.11 {Tk_ComputeTextLayout: absorb spaces at eol} {
set x {}
.b.l config -text "000 000" -wrap [expr $ax*5]