Tk Source Code

View Ticket
Login
Ticket UUID: 67335ebb7017fbbb7a4db557ed11dcddc12867fa
Title: Revised [text]: changing the -elide option of a tag to or from {} fails an assertion
Type: Bug Version: revised_text
Submitter: nab Created on: 2026-10-13 17:21:07
Subsystem: 18. [text] Assigned To:
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-13 17:23:13
Resolution: Fixed Closed By:
    Closed on:
Description:

In the revised text widget, changing the -elide option of a tag from 1 to {} fails an assertion when an adjacent range is elided by another tag (build with --enable-symbols):

pack [text .t]
.t insert end zxk
.t tag configure C -elide 1
.t tag configure B -elide 1
.t tag add C 1.0 1.1
.t tag add B 1.1 1.3
.t tag configure B -elide {}
tkTextBTree.c: TkBTreeFindStartOfElidedRange: Assertion `SegmentIsElided(sharedTextPtr, segPtr, textPtr)' failed.

Changing an -elide 0 tag to {} also does not elide the text of a lower -elide 1 tag when nothing else is elided: with B -elide 1 on 1.2-1.4 and A -elide 0 on 1.0-1.6, after .t tag configure A -elide {} the displayed text is still abcdef instead of abef.

Cause: when -elide changes, the elide state before the change is rebuilt by inverting -elide (0 and 1), which cannot express {}; and the update returns early when nothing is elided, although removing an -elide 0 tag can elide text. Found while fuzzing the elide handling ([05411ee533]).

User Comments: nab added on 2026-10-13 17:23:13:

Fixed in [fc1274dd3e|fc1274dd3e], merged into revised_text with [eea332730c|eea332730c]. Tests textTag-20.5 to 20.7.