Tk Source Code

Check-in [9d5e1c4b]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added test case text-27.26 for [.text edit undo/redo] return values
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-449
Files: files | file ages | folders
SHA1:9d5e1c4be8521e80270a7f6dd766a43732d467eb
User & Date: fvogel 2016-06-08 13:23:22
Context
2016-06-11
15:12
Merged core-8-6-branch check-in: 32c88915 user: fvogel tags: tip-449
2016-06-08
13:23
Added test case text-27.26 for [.text edit undo/redo] return values check-in: 9d5e1c4b user: fvogel tags: tip-449
09:38
It is not possible to rely only on the interp result. A list of indices has to be built as a return value to undo/redo because there can be several edits between two separators and all such edits have to report which range of text they changed. Note: this commit does not deal with refcounts, it is very likely wrong in that respect. check-in: afa23a02 user: fvogel tags: tip-449
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/text.test.

6558
6559
6560
6561
6562
6563
6564






























6565
6566
6567
6568
6569
6570
6571
    .t edit undo
    update ; lappend res $nbUS
    .t edit reset
    update ; lappend res $nbUS
} -cleanup {
    destroy .t
} -result {0 0 1 2 3 4 4 5 6 6 7 8 8 9}
































test text-28.1 {bug fix - 624372, ControlUtfProc long lines} -body {
    pack [text .t -wrap none]
    .t insert end [string repeat "\1" 500]
} -cleanup {
    destroy .t







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
    .t edit undo
    update ; lappend res $nbUS
    .t edit reset
    update ; lappend res $nbUS
} -cleanup {
    destroy .t
} -result {0 0 1 2 3 4 4 5 6 6 7 8 8 9}
test text-27.26 {edit undo and edit redo return ranges} -setup {
    destroy .t
    set res {}
} -body {
    text .t -undo true -autoseparators false
    .t insert end "Hello "
    .t edit separator
    .t insert end "World!\n"
    .t insert 1.6 "GREAT "
    .t insert end "Another edit here!!"
    lappend res [.t edit undo]
    lappend res [.t edit redo]
    .t edit separator
    .t delete 1.6
    .t delete 1.9 1.10
    .t insert 1.9 L
    lappend res [.t edit undo]
    lappend res [.t edit redo]
    .t replace 1.6 1.10 Tcl/Tk
    .t replace 2.8 2.12 "one bites the dust"
    lappend res [.t edit undo]
    lappend res [.t edit redo]
} -cleanup {
    destroy .t
} -result [list {2.0 2.19 1.6 1.12 1.6 2.0} \
                {1.6 2.0 1.6 1.12 2.0 2.19} \
                {1.9 1.10 1.9 1.10 1.6 1.7} \
                {1.6 1.7 1.9 1.10 1.9 1.10} \
                {2.8 2.26 2.8 2.12 1.6 1.12 1.6 1.10} \
                {1.6 1.10 1.6 1.12 2.8 2.12 2.8 2.26} ]


test text-28.1 {bug fix - 624372, ControlUtfProc long lines} -body {
    pack [text .t -wrap none]
    .t insert end [string repeat "\1" 500]
} -cleanup {
    destroy .t