Subject: while is better than if because it deals with wrapped lines then.

From: fvogel <[email-masked]>
Date: Sun, 7 Feb 2016 19:21:04 +0000

---
 generic/tkTextDisp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index fe69f28..91642f9 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4683,7 +4683,7 @@ TextChanged(
          */
 
         lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded);
-        if ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) {
+        while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) {
             lastPtr = lastPtr->nextPtr;
         }
 
-- 
cgit v0.12