summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkTextDisp.c8
-rw-r--r--tests/textDisp.test3
2 files changed, 4 insertions, 7 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f2e760b..07623c4 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4749,6 +4749,9 @@ TextChanged(
*/
lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded);
+ while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) {
+ lastPtr = lastPtr->nextPtr;
+ }
/*
* At least one display line is supposed to change. This makes the
@@ -4765,11 +4768,6 @@ TextChanged(
}
}
- while ((lastPtr != NULL)
- && (lastPtr->index.linePtr == index2Ptr->linePtr)) {
- lastPtr = lastPtr->nextPtr;
- }
-
/*
* Delete all the DLines from firstPtr up to but not including lastPtr.
*/
diff --git a/tests/textDisp.test b/tests/textDisp.test
index f5fbd3d..5ac2e7a 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -1191,8 +1191,7 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an
# because during (b) findDLine cannot return the display line the
# cursor is in since this display line was just unlinked in (a).
} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}}
-
-test textDisp-8.13 {TkTextChanged, [06c1433906]} {
+test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} {
.t delete 1.0 end
.t insert 1.0 \nLine1\nLine2\n
update