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)
commit43202bdf5b7678279ad57e69854c36c6a6e8c72d (patch)
tree756feba5ca87ddf98ea57401e90da2be2dbdd405 /tests
parent6e70d0c9924222b58ed4e45ca85bdc52104ed4e4 (diff)
downloadtk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.zip
tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.tar.gz
tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.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