Tk Source Code

Check-in [22f07785]
Login

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

Overview
Comment:Merge nab-reliquats: harden elision, tag and section handling against the remaining corruption classes. Undo/redo of deletions now reconciles the elide topology of the restored range with the current tag information (UpdateElideInfo gets a recompute mode; covers tags excluded from undo and elide states reconfigured between deletion and undo); insertion of non-elided text inside an elided range splits the range (meeting point of two elide tags); switches enrolled in undo tokens survive the annihilation of their counterpart (annihilation marker, stash references, drop at restore); the index arithmetic of joined delete undo tokens handles line-crossing chunks and refuses mark-based joins it cannot compute; the section producers no longer leave short sections at arbitrary cuts (RebuildSections giveback, SplitSection walk-back, BalanceSectionWithLeft, rebalancing after boundary mark removal); [pathName clear] works on peers; tag clearing repairs its range search beyond the boundary line, its undo change list anchoring, its line cache references, partial clears of elided ranges, and re-merges interior chunk boundaries at undo; the branch search examines the first line of a node; TkBTreeTag sets up its undo information before the elision update frees merged segments. With regression tests btree-14.40 - 14.83, text-27.37 - 27.43, text-42.1/42.2.
Downloads: See separate download page
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 22f077854e0064e19b4a32325098c38367bb87d4ec09175753d99935f30df814
User & Date: nab 2026-07-15 17:26:37.361
Context
2026-07-15
19:51
Merge nab-reliquats (via nab-tagops-merge): tag clearing undo trigger and boundary line cache repairs, restore proc fork hygiene, UpdateElideInfo walk pairing and search anchoring. See the branch commits for the root causes. Tests btree-14.84 - 14.91. check-in: ee19ce1e user: nab tags: revised_text, tip-466
19:30
Staging merge of nab-reliquats for revised_text: tag clearing undo trigger and boundary line cache repairs, restore proc fork hygiene, UpdateElideInfo walk pairing and search anchoring. See the branch commits for the root causes. Tests btree-14.84 - 14.91. leaf check-in: 3be0e1c8 user: nab tags: nab-tagops-merge
17:26
Merge nab-reliquats: harden elision, tag and section handling against the remaining corruption classes. Undo/redo of deletions now reconciles the elide topology of the restored range with the current tag information (UpdateElideInfo gets a recompute mode; covers tags excluded from undo and elide states reconfigured between deletion and undo); insertion of non-elided text inside an elided range splits the range (meeting point of two elide tags); switches enrolled in undo tokens survive the annihilation of their counterpart (annihilation marker, stash references, drop at restore); the index arithmetic of joined delete undo tokens handles line-crossing chunks and refuses mark-based joins it cannot compute; the section producers no longer leave short sections at arbitrary cuts (RebuildSections giveback, SplitSection walk-back, BalanceSectionWithLeft, rebalancing after boundary mark removal); [pathName clear] works on peers; tag clearing repairs its range search beyond the boundary line, its undo change list anchoring, its line cache references, partial clears of elided ranges, and re-merges interior chunk boundaries at undo; the branch search examines the first line of a node; TkBTreeTag sets up its undo information before the elision update frees merged segments. With regression tests btree-14.40 - 14.83, text-27.37 - 27.43, text-42.1/42.2. check-in: 22f07785 user: nab tags: revised_text, tip-466
15:07
Revert the too aggressive part of the previous commit's restore-proc change: dropping a restored switch whenever its stashed counterpart does not point back regressed pure delete/undo/redo round trips (a whole switch pair dying in the same token has the counterpart legitimately paired to another live switch, structurally indistinguishable from the case the change targeted - a mismatch in the number of links and branches followed). The restore procs drop only on the annihilation marker again (NULL fork), as before. The case where an elision update repairs the counterpart pairing between the deletion and the redo (a restored switch stealing its counterpart back, orphaned link) is left as a known bug: it cannot be told apart at the restore proc, its fix belongs in the post-restore reconciliation and is deferred (repro P7). The unused defensive kept-branch reconnection after the walk (never exercised) is dropped as well. check-in: 6bc537f0 user: nab tags: nab-reliquats
10:19
Merge nab-deleterange-elide: make deletions and undo/redo across elided region boundaries reliable. DeleteRange handles all switch topologies of a deletion range (separate savedLinkPtr/savedBranchPtr, merge of regions becoming adjacent, canonicalization of regions adjacent to the range, counter transfer at line joins, byte-position anchor for the surrogate newline); UndoDeletePerform restores switches with correct sections, counters and mark ordering in multiline tokens, releases the token references (leak), and keeps dead switches out of foreign token chains; delete undo tokens holding switches are not joined anymore; 'edit reset' and ClearText dispose of the retained tag/mark undo tokens; a full undo stack evicts its oldest atom instead of retaining stale ones; TkRangeListDelete/Add/Contains repairs. With regression tests btree-14.12 - btree-14.39, text-27.32/33/35/36, textDisp-38.1 - 38.3. check-in: 182404a7 user: nab tags: revised_text, tip-466
Changes
Unified Diff Side-by-Side Diff Patch
Changes to generic/tkText.c.
Changes to generic/tkTextBTree.c.
Changes to tests/text.test.
Changes to tests/textBTree.test.