Tk Source Code

Check-in [f8c5c81c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Speed up the RTL auto-detection of the text widget and fix its per-widget state.

The Text class bindings scanned every line in Tcl and removed the RTL tag line by line on every <Map> and after every insert, which made mapping many or large text widgets very slow. Now the scan is skipped if the text contains no RTL characters, the tag is removed once, and lines are checked with regular expressions. RTL characters now include all characters with Unicode Bidi_Class R or AL, not only U+0590-U+08FF. The pending flag is now per widget (a second widget changed in the same idle cycle was not re-tagged), and the per-widget flags are removed when the widget is destroyed (a recreated widget was not scanned). [Bug 5d983ebf48]

Downloads: See separate download page
Timelines: family | ancestors | descendants | both | text-rtl-detect-speed
Files: files | file ages | folders
SHA3-256: f8c5c81cb4e456bb8e37b93b8757ff1f3e181c105c0a292bbcd3de771aa8eccc
User & Date: serhiy.storchaka 2026-09-24 11:09:21.104
Context
2026-09-29
08:18
Add tests textTag-19.5 to 19.7 for all RTL character ranges, characters outside them, and punctuation and whitespace in RTL lines [5d983ebf48]. closed check-in: 28f9b9c3 user: serhiy.storchaka tags: text-rtl-detect-speed
2026-09-24
11:09
Speed up the RTL auto-detection of the text widget and fix its per-widget state.

The Text class bindings scanned every line in Tcl and removed the RTL tag line by line on every <Map> and after every insert, which made mapping many or large text widgets very slow. Now the scan is skipped if the text contains no RTL characters, the tag is removed once, and lines are checked with regular expressions. RTL characters now include all characters with Unicode Bidi_Class R or AL, not only U+0590-U+08FF. The pending flag is now per widget (a second widget changed in the same idle cycle was not re-tagged), and the per-widget flags are removed when the widget is destroyed (a recreated widget was not scanned). [Bug 5d983ebf48] check-in: f8c5c81c user: serhiy.storchaka tags: text-rtl-detect-speed

2026-09-23
10:33
Fix for [3de1b72157]: ttk::notebook takes the focus when clicked, even with the -takefocus 0 option. check-in: a695f427 user: csaba tags: trunk, main
Changes
Unified Diff Side-by-Side Diff Patch
Changes to library/text.tcl.
Changes to tests/textTag.test.