Tk Source Code

View Ticket
Login
Ticket UUID: 3d27c3e6361f6a50efbcacd8b743552f2e3fcbc2
Title: Revised [text]: tk_textInsert and tk_textReplace reject -hyphentags at its documented place
Type: Bug Version: revised_text
Submitter: nab Created on: 2026-10-14 06:47:06
Subsystem: 18. [text] Assigned To:
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-14 06:47:34
Resolution: Fixed Closed By:
    Closed on:
Description:

The manual gives tk_textInsert pathName ?-hyphentags tagList? index chars ?tagList chars tagList ...?, and the same for tk_textReplace, but the option is only accepted after the index:

text .t
.t insert end abcdef
tk_textInsert .t -hyphentags P 1.2 xy
bad text index "-hyphentags"

At the place where the implementation looks for it, any argument starting with "-" is taken for an option, so chars starting with "-" can't be inserted with a tag list:

tk_textInsert .t 1.2 -x T
bad option "-x": must be -hyphentags

tk_textReplace .t 1.1 1.3 -x T gives the same error after the range has been deleted.

The option is now accepted before the indices, as documented. After the indices, where the test suite uses it, only the word -hyphentags followed by more arguments is an option. The synopsis of tk_textReplace in the manual also gets its two indices.

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

Fixed in [d29a1c0dcf|d29a1c0dcf], merged into revised_text with [6b9cd9fac9|6b9cd9fac9]. Tests text-47.1 to 47.3.