summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-01-24 14:58:03 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-01-24 14:58:03 (GMT)
commitea43a59d78e134c9e2fcf6bc8c47337bbc28b5e5 (patch)
treef38ea602db1991d6f158b487369145dfa7ac873f /tests
parentc320b51ca710d690037560ed5a0b53211e06ec53 (diff)
downloadtk-ea43a59d78e134c9e2fcf6bc8c47337bbc28b5e5.zip
tk-ea43a59d78e134c9e2fcf6bc8c47337bbc28b5e5.tar.gz
tk-ea43a59d78e134c9e2fcf6bc8c47337bbc28b5e5.tar.bz2
TkTextIndexCount is counting chars. Fix these calls where bytes counting is needed. Among other issues, this fixes horizontal scrolling when typing text at the end of a line containing multi-byte characters.
Diffstat (limited to 'tests')
-rw-r--r--tests/textDisp.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 1f85117..44a45b2 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -1664,6 +1664,29 @@ test textDisp-13.10 {TkTextSeeCmd procedure} {} {
destroy $w
set res
} {}
+test textDisp-13.11 {TkTextSeeCmd procedure} {} {
+ # insertion of a character at end of a line containing multi-byte
+ # characters and calling see at the line end shall actually show
+ # this character
+ toplevel .top2
+ pack [text .top2.t2 -wrap none]
+ for {set i 1} {$i < 5} {incr i} {
+ .top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n
+
+ }
+ wm geometry .top2 300x200+0+0
+ update
+ .top2.t2 see "1.0 lineend"
+ update
+ set ref [.top2.t2 index @0,0]
+ .top2.t2 insert "1.0 lineend" ç
+ .top2.t2 see "1.0 lineend"
+ update
+ set new [.top2.t2 index @0,0]
+ set res [.top2.t2 compare $ref == $new]
+ destroy .top2
+ set res
+} {0}
wm geom . {}
.t configure -wrap none