Tk Source Code

View Ticket
Login
Ticket UUID: 7f951f0aa8fc4201b726582fd0c4297962e94c2b
Title: Revised [text]: soft hyphens with an -elide 0 tag inserted into an elided range fail an assertion
Type: Bug Version: revised_text
Submitter: nab Created on: 2026-10-14 06:47:06
Subsystem: 18. [text] Assigned To:
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-14 06:47:34
Resolution: Fixed Closed By:
    Closed on:
Description:

In the revised text widget, inserting elided chars with soft hyphens whose -hyphentags include a higher tag with -elide 0 fails an assertion (build with --enable-symbols):

text .t
.t insert end abcdef
.t tag configure A -elide 0
.t tag configure B -elide 1
.t tag raise A
.t tag add B 1.1 1.6
tk_textInsert .t 1.3 -hyphentags {A} "u\u00adv" B
Assertion failed: (SegmentIsElided(sharedTextPtr, segPtr, textPtr)), function TkBTreeFindStartOfElidedRange

The elided ranges are updated from the elide tag of the chars over the whole inserted range, which also holds the soft hyphens, and these are not elided. When the soft hyphens have another elide tag than the chars, the elided ranges of the insertion are now recomputed from the tags. Found by fuzzing insertions with tags and soft hyphens.

User Comments: nab added on 2026-10-14 06:47:34:

Fixed in [49dbc14178|49dbc14178], merged into revised_text with [6b9cd9fac9|6b9cd9fac9]. Test btree-14.130.