Tk Source Code

View Ticket
Login
Ticket UUID: cddda7d44e1c89249b3564955fb9b32ebb736222
Title: Revised [text]: a newline inserted after a soft hyphen fails an assertion
Type: Bug Version: revised_text
Submitter: nab Created on: 2026-10-13 19:55:40
Subsystem: 18. [text] Assigned To:
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-13 19:55:49
Resolution: Fixed Closed By:
    Closed on:
Description:

In the revised text widget, inserting a newline after a soft hyphen (U+00AD) fails an assertion (build with --enable-symbols) when the split line already has a tag on a part of it:

text .t
.t insert end ab A
.t insert end c
.t insert 1.3 "s\u00ad\no"

or when the inserted text spans a line without soft hyphen:

text .t
.t insert end q
.t tk_textInsert 1.0 -hyphentags P "a\u00adb\nc\nd\u00ade"
tkTextBTree.c: TkBTreeInsertChars: Assertion `linePtr->tagoffPtr == emptyTagInfoPtr' failed.

Once a soft hyphen has been inserted, the line tag information of each line is not recomputed but derived from the tags of the soft hyphens, as if every line had them on its whole content. Found by fuzzing insertions with tags and soft hyphens.

User Comments: nab added on 2026-10-13 19:55:49:

Fixed in [76bc9f50f6|76bc9f50f6], merged into revised_text with [5580484fd8|5580484fd8]. Tests btree-14.123 and 14.124.