diff options
-rw-r--r-- | generic/tkTextDisp.c | 13 |
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; + } } /* |