Tk Source Code

View Ticket
Login
Ticket UUID: 3475627
Title: Test text-31.11 fails
Type: Bug Version: obsolete: 8.5.10
Submitter: fvogel Created on: 2012-01-18 20:50:40
Subsystem: 18. [text] Assigned To: fvogel
Priority: 7 High Severity: Minor
Status: Closed Last Modified: 2014-02-19 21:42:30
Resolution: Fixed Closed By: fvogel
    Closed on: 2013-09-23 21:41:13
Description:
==== text-31.11 peer widget -start, -end FAILED
==== Contents of test case:

    .t delete 1.0 end
    for {set i 1} {$i < 100} {incr i} {
        .t insert end "Line $i\n"
    }
    set res [.t index end]
    lappend res [catch {.t configure -start 5 -end 15}]
    lappend res [.t index end]
    lappend res [catch {.t configure -start 10 -end 40}]
    lappend res [.t index end]
    .t configure -start {} -end {}
    lappend res [.t index end]
    set res

---- Result was:
101.0 0 97.0 0 92.0 101.0
---- Result should have been (exact matching):
101.0 0 11.0 0 31.0 101.0
==== text-31.11 FAILED


Happens on both core-8-5-branch and trunk
User Comments: fvogelnew1 added on 2012-01-26 03:19:23:

allow_comments - 1

fvogelnew1 added on 2012-01-26 03:19:22:
Patch has been applied today to core-8-5-branch and trunk.
Closing now.

fvogelnew1 added on 2012-01-21 00:15:13:
When changing -startline and/or -endline, any text index becomes potentially outdated.

Therefore textPtr->sharedTextPtr->stateEpoch must be incremented in function ConfigureText so that indices get recomputed when queried after such a change.

I have proposed a patch fixing this:

https://sourceforge.net/tracker/index.php?func=detail&aid=3476698&group_id=12997&atid=312997