Update to tk 8.5.19

This commit is contained in:
Zachary Ware
2017-11-24 17:53:51 -06:00
parent 27e7dfc7da
commit c67b328f06
325 changed files with 12511 additions and 12047 deletions

View File

@@ -698,7 +698,64 @@ test text-9.2.44 {TextWidgetCmd procedure, "count" option} -setup {
.t tag add hidden 2.9 3.17
.t tag configure hidden -elide true
lappend res [.t count -displaylines 1.19 3.24] [.t count -displaylines 1.0 end]
} -result {2 6 2 5}
} -result {2 6 1 5}
test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup {
.t delete 1.0 end
update
set res {}
} -body {
for {set i 1} {$i < 5} {incr i} {
.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n"
}
.t tag configure hidden -elide true
.t tag add hidden 2.15 3.10
.t configure -wrap none
set res [.t count -displaylines 2.0 3.0]
} -result {0}
test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup {
toplevel .mytop
pack [text .mytop.t -font TkFixedFont -bd 0 -padx 0 -wrap char]
set spec [font measure TkFixedFont "Line 1+++Line 1---Li"] ; # 20 chars
append spec x300+0+0
wm geometry .mytop $spec
.mytop.t delete 1.0 end
update
set res {}
} -body {
for {set i 1} {$i < 5} {incr i} {
# 0 1 2 3 4
# 012345 678901234 567890123 456789012 34567890123456789
.mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n"
}
.mytop.t tag configure hidden -elide true
.mytop.t tag add hidden 2.30 3.10
lappend res [.mytop.t count -displaylines 2.0 3.0]
lappend res [.mytop.t count -displaylines 2.0 3.50]
} -cleanup {
destroy .mytop
} -result {1 3}
test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup {
.t delete 1.0 end
update
set res {}
} -body {
for {set i 1} {$i < 25} {incr i} {
.t insert end "Line $i\n"
}
.t tag configure hidden -elide true
.t tag add hidden 5.7 11.0
update
# next line to be fully sure that asynchronous line heights calculation is
# up-to-date otherwise this test may fail (depending on the computer
# performance), especially when the . toplevel has small height
.t count -update -ypixels 1.0 end
set y1 [lindex [.t yview] 1]
.t count -displaylines 5.0 11.0
set y2 [lindex [.t yview] 1]
.t count -displaylines 5.0 12.0
set y3 [lindex [.t yview] 1]
list [expr {$y1 == $y2}] [expr {$y1 == $y3}]
} -result {1 1}
# Newer tags are higher priority
.t tag configure elide1 -elide 0
@@ -1215,9 +1272,10 @@ test text-17.8 {DeleteChars procedure} {
.t tag add sel 1.0 end
.t delete 4.0 end
list [.t tag ranges sel] [.t get 1.0 end]
} {{1.0 3.5} {Line 1
} {{1.0 4.0} {Line 1
abcde
12345
}}
test text-17.9 {DeleteChars procedure} {
setup
@@ -2728,6 +2786,24 @@ test text-20.185 {TextSearchCmd, elide up to match} {
lappend res [.t2 search -regexp bc 1.0]
lappend res [.t2 search -regexp c 1.0]
} {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
test text-20.185.1 {TextSearchCmd, elide up to match, with UTF-8 chars before the match} {
deleteWindows
pack [text .t2]
.t2 tag configure e -elide 0
.t2 insert end A {} xyz e bb\n
.t2 insert end \u00c4 {} xyz e bb
set res {}
lappend res [.t2 search bb 1.0 "1.0 lineend"]
lappend res [.t2 search bb 2.0 "2.0 lineend"]
lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"]
lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"]
.t2 tag configure e -elide 1
lappend res [.t2 search bb 1.0 "1.0 lineend"]
lappend res [.t2 search bb 2.0 "2.0 lineend"]
lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"]
lappend res [.t2 search -regexp -elide bb 2.0 "2.0 lineend"]
lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"]
} {1.4 2.4 1.4 2.4 1.4 2.4 1.4 2.4 2.4}
test text-20.186 {TextSearchCmd, strict limits} {
deleteWindows
pack [text .t2]
@@ -3152,6 +3228,95 @@ test text-25.18 {patch 1469210 - inserting after undo} -setup {
} -cleanup {
destroy .t
} -result 1
test text-25.19 {patch 1669632 (i) - undo after <Control-1>} -setup {
destroy .t
} -body {
text .t -undo 1
.t insert end foo\nbar
.t edit reset
.t insert 2.2 WORLD
event generate .t <Control-1> -x 1 -y 1
.t insert insert HELLO
.t edit undo
.t get 2.2 2.7
} -cleanup {
destroy .t
} -result WORLD
test text-25.20 {patch 1669632 (iv) - undo after <Control-backslash>} -setup {
destroy .t
} -body {
toplevel .top
pack [text .top.t -undo 1]
.top.t insert end "This is an example text"
.top.t edit reset
.top.t mark set insert 1.5
.top.t insert 1.5 HELLO
.top.t tag add sel 1.10 1.12
update
focus -force .top.t
event generate .top.t <Control-backslash>
.top.t insert insert " WORLD "
.top.t edit undo
.top.t get 1.5 1.10
} -cleanup {
destroy .top.t .top
} -result HELLO
test text-25.21 {patch 1669632 (vii) - <<Undo>> shall not remove separators} -setup {
destroy .t
} -body {
text .t -undo 1
.t insert end "This is an example text"
.t edit reset
.t insert 1.5 "WORLD "
event generate .t <Control-1> -x 1 -y 1
.t insert insert HELLO
event generate .t <<Undo>>
.t insert insert E
event generate .t <<Undo>>
.t get 1.0 "1.0 lineend"
} -cleanup {
destroy .t
} -result "This WORLD is an example text"
test text-25.22 {patch 1669632 (v) - <<Clear>> is atomic} -setup {
destroy .t
} -body {
toplevel .top
pack [text .top.t -undo 1]
.top.t insert end "This is an example text"
.top.t edit reset
.top.t mark set insert 1.5
.top.t insert 1.5 "A"
update
focus -force .top.t
event generate .top.t <Delete>
event generate .top.t <Shift-Right>
event generate .top.t <<Clear>>
event generate .top.t <Delete>
event generate .top.t <<Undo>>
.top.t get 1.0 "1.0 lineend"
} -cleanup {
destroy .top.t .top
} -result "This A an example text"
test text-25.23 {patch 1669632 (v) - <<Cut>> is atomic} -setup {
destroy .t
} -body {
toplevel .top
pack [text .top.t -undo 1]
.top.t insert end "This is an example text"
.top.t edit reset
.top.t mark set insert 1.5
.top.t insert 1.5 "A"
update
focus -force .top.t
event generate .top.t <Delete>
event generate .top.t <Shift-Right>
event generate .top.t <<Cut>>
event generate .top.t <Delete>
event generate .top.t <<Undo>>
.top.t get 1.0 "1.0 lineend"
} -cleanup {
destroy .top.t .top
} -result "This A an example text"
test text-26.1 {bug fix - 624372, ControlUtfProc long lines} {
destroy .t