From e07d132fbb2cfe30c33750fafbad2f661d854487 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 14 Dec 2014 16:48:25 +0000 Subject: At least one display line is supposed to change when calling TkTextChanged. --- generic/tkTextDisp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; + } } /* -- cgit v0.12