Tk Source Code

Check-in [4bce1cc1]
Login

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

Overview
Comment:Fix [bdd1f64523]: Assertion failed when switching -elide in the revised text widget
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 4bce1cc1321b13b32b06017f4f0c31453addfe9409bea5935caae0f568333c22
User & Date: fvogel 2025-02-01 15:08:43
References
2025-02-01
15:51
Add non-regression test btree-14.3 crashing before the fix in the previous commit [4bce1cc1]. Leaf check-in: b8129965 user: fvogel tags: revised_text, tip-466
15:26 Ticket [bdd1f645] Assertion failed when switching -elide in the revised text widget status still Open with 5 other changes artifact: 2e790be3 user: fvogel
Context
2025-02-01
15:51
Add non-regression test btree-14.3 crashing before the fix in the previous commit [4bce1cc1]. Leaf check-in: b8129965 user: fvogel tags: revised_text, tip-466
15:08
Fix [bdd1f64523]: Assertion failed when switching -elide in the revised text widget check-in: 4bce1cc1 user: fvogel tags: revised_text, tip-466
14:38
Fix logic error in comment. We are in the case (actualElided != shouldBeElided), i.e. these two boolean variables are different. Inside this case, we're in the else clause of an 'if (shouldBeElided)', therefore this else clause is the case 'if (actualElided)', not 'if (!actualElided)'. check-in: e4ceb24e user: fvogel tags: revised_text, tip-466
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tkTextBTree.c.
8864
8865
8866
8867
8868
8869
8870



8871



8872
8873



8874
8875
8876
8877
8878
8879
8880
		     * We have to insert a link.
		     */

		    if (!lastBranchPtr) {
			/*
			 * The related branch is starting outside of this range,
			 * so we have to search for it.



			 */



			lastBranchPtr = TkBTreeFindStartOfElidedRange(sharedTextPtr, NULL, *firstSegPtr);
			assert(lastBranchPtr->typePtr == &tkTextBranchType);



		    }

		    if (deletedLinkPtr) {
			lastLinkPtr = deletedLinkPtr;
			deletedLinkPtr = NULL;
		    } else {
			lastLinkPtr = MakeLink();







>
>
>

>
>
>


>
>
>







8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
		     * We have to insert a link.
		     */

		    if (!lastBranchPtr) {
			/*
			 * The related branch is starting outside of this range,
			 * so we have to search for it.
			 * Since TkBTreeFindStartOfElidedRange search starts from a supposedly elided segment
			 * and since the elide state of that segment is obtained from the tag information of
			 * that segment, we need to temporarily restore the original elide state of the tag.
			 */
			if (tagPtr && reason == ELISION_HAS_BEEN_CHANGED) {
			    if (tagPtr->elide >= 0) tagPtr->elide = !tagPtr->elide;
			}
			lastBranchPtr = TkBTreeFindStartOfElidedRange(sharedTextPtr, NULL, *firstSegPtr);
			assert(lastBranchPtr->typePtr == &tkTextBranchType);
			if (tagPtr && reason == ELISION_HAS_BEEN_CHANGED) {
			    if (tagPtr->elide >= 0) tagPtr->elide = !tagPtr->elide;
			}
		    }

		    if (deletedLinkPtr) {
			lastLinkPtr = deletedLinkPtr;
			deletedLinkPtr = NULL;
		    } else {
			lastLinkPtr = MakeLink();