summaryrefslogtreecommitdiffstats
path: root/tests/textDisp.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-01-24 14:58:03 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-01-24 14:58:03 (GMT)
commit662480c9ebe208020fd0484bbd7908dbb0fa7562 (patch)
treef38ea602db1991d6f158b487369145dfa7ac873f /tests/textDisp.test
parent2a1df1da7fd04bf2163249f588314d1ae33d12f5 (diff)
downloadtk-662480c9ebe208020fd0484bbd7908dbb0fa7562.zip
tk-662480c9ebe208020fd0484bbd7908dbb0fa7562.tar.gz
tk-662480c9ebe208020fd0484bbd7908dbb0fa7562.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/textDisp.test')
-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