diff options
author | fvogel <fvogelnew1@free.fr> | 2021-04-18 11:54:03 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2021-04-18 11:54:03 (GMT) |
commit | f910d73ddae2b049ae3c82bd3eb6c840ed2ef32c (patch) | |
tree | d9101aabc48d0c5ac72e6ff708a240a770de2366 /tests | |
parent | 4f342cf8461171eafee55086646adde29dd8631c (diff) | |
parent | ad62abdbadab35439f45dcb00a2cce9f18526da6 (diff) | |
download | tk-f910d73ddae2b049ae3c82bd3eb6c840ed2ef32c.zip tk-f910d73ddae2b049ae3c82bd3eb6c840ed2ef32c.tar.gz tk-f910d73ddae2b049ae3c82bd3eb6c840ed2ef32c.tar.bz2 |
Fix [ea876b3e8a]: Text peer widget ignores set -startline when scrolling with the scrollbar.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/text.test | 4 | ||||
-rw-r--r-- | tests/textDisp.test | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/tests/text.test b/tests/text.test index 6bd0ae4..9ee0eff 100644 --- a/tests/text.test +++ b/tests/text.test @@ -7419,10 +7419,10 @@ test text-32.3 {peer widget -start, -end and deletion (bug 1630262)} -setup { .pt delete 2.0 3.0 # moreover -startline shall be correct # (was wrong before fixing bug 1630262) - lappend res [.t cget -start] [.pt cget -start] + lappend res [.t cget -start] [.pt cget -start] [.t get @0,0 "@0,0 lineend"] } -cleanup { destroy .pt -} -result {4 3} +} -result {4 3 {Line 5}} test text-32.4 {peer widget -start, -end and deletion (bug 1630262)} -setup { destroy .t .pt diff --git a/tests/textDisp.test b/tests/textDisp.test index ac80069..b35a107 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1660,6 +1660,21 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} .top.t see 1.0 .top.t index @0,[expr {$lineheight - 2}] } {1.0} +test textDisp-11.22 {TkTextSetYView, peer has -startline} { + .top.t delete 1.0 end + for {set i 1} {$i <= 50} {incr i} { + .top.t insert end "Line $i\n" + } + pack [.top.t peer create .top.p] -side left + pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y + .top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set} + updateText + .top.p yview moveto 0 + updateText + set res [.top.p get @0,0 "@0,0 lineend"] + destroy .top.p + set res +} {Line 5} .t configure -wrap word .t delete 50.0 51.0 |