diff options
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r-- | generic/tkTextBTree.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 0038e64..005ce46 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -662,12 +662,12 @@ AdjustStartEndRefs( if (textPtr->start != NULL) { count--; treePtr->startEnd[count] = textPtr->start; - treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers; + treePtr->startEndRef[count] = textPtr; } if (textPtr->end != NULL) { count--; treePtr->startEnd[count] = textPtr->end; - treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers; + treePtr->startEndRef[count] = textPtr; } } } @@ -1609,7 +1609,7 @@ TkBTreeFindLine( } /* - * Check for the any start/end offset for this text widget. + * Check for any start/end offset for this text widget. */ if (textPtr != NULL) { @@ -1993,6 +1993,11 @@ TkBTreeLinesTo( } if (textPtr != NULL && textPtr->start != NULL) { index -= TkBTreeLinesTo(NULL, textPtr->start); + if (index < 0) { + /* One should panic here! + Tcl_Panic("TkBTreeLinesTo: linePtr comes before -startline"); + */ + } } return index; } |