From 058f23a24104bd1f6dc55ae34e35dd61004f0735 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 30 Dec 2014 17:36:06 +0000 Subject: A logical line is merged with its previous line if and only if the eol of the previous line is elided ([926d2c3900] was not fully correct). --- generic/tkTextDisp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c310100..c21b600 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5401,7 +5401,8 @@ MeasureUp( for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) { distance -= dlPtr->height; if (distance <= 0) { - *dstPtr = dlPtr->index; + TkTextIndex tmpIndex = dlPtr->index; + *dstPtr = dlPtr->index; /* * Adjust index to the start of the display line. This is @@ -5410,9 +5411,9 @@ MeasureUp( * eol is not elided). */ - if (TkTextIsElided(textPtr, dstPtr, NULL)) { - TkTextFindDisplayLineEnd(textPtr, dstPtr, 0, - NULL); + TkTextIndexBackBytes(textPtr, &tmpIndex, 1, &tmpIndex); + if (TkTextIsElided(textPtr, &tmpIndex, NULL)) { + TkTextFindDisplayLineEnd(textPtr, dstPtr, 0, NULL); } if (overlap != NULL) { *overlap = -distance; @@ -5805,6 +5806,7 @@ YScrollByLines( for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) { offset++; if (offset == 0) { + TkTextIndex tmpIndex = dlPtr->index; textPtr->topIndex = dlPtr->index; /* @@ -5814,7 +5816,8 @@ YScrollByLines( * true if the eol is not elided). */ - if (TkTextIsElided(textPtr, &textPtr->topIndex, NULL)) { + TkTextIndexBackBytes(textPtr, &tmpIndex, 1, &tmpIndex); + if (TkTextIsElided(textPtr, &tmpIndex, NULL)) { TkTextFindDisplayLineEnd(textPtr, &textPtr->topIndex, 0, NULL); } -- cgit v0.12