summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2014-12-14 16:48:25 (GMT)
committerfvogel <fvogelnew1@free.fr>2014-12-14 16:48:25 (GMT)
commite07d132fbb2cfe30c33750fafbad2f661d854487 (patch)
treee8a55ca4eae28a8439e1fb6f36bf2040032e2869
parent32e3e378a52b2489974304d4805b173d1a4ca093 (diff)
downloadtk-e07d132fbb2cfe30c33750fafbad2f661d854487.zip
tk-e07d132fbb2cfe30c33750fafbad2f661d854487.tar.gz
tk-e07d132fbb2cfe30c33750fafbad2f661d854487.tar.bz2
At least one display line is supposed to change when calling TkTextChanged.
-rw-r--r--generic/tkTextDisp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f9a28a1..e87b5e8 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4650,6 +4650,19 @@ TextChanged(
*/
lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded);
+
+ /*
+ * At least one display line is supposed to change. This makes the
+ * redisplay OK in case the display line we expect to get here was
+ * unlinked by a previous call to TkTextChanged and the text widget
+ * did not update before reaching this point. This happens for
+ * instance when moving the cursor up one line.
+ * Note that lastPtr != NULL here, otherwise we would have returned
+ * earlier when we tested for firstPtr being NULL.
+ */
+ if (lastPtr == firstPtr) {
+ lastPtr = lastPtr->nextPtr;
+ }
}
/*