summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2014-12-30 17:36:06 (GMT)
committerfvogel <fvogelnew1@free.fr>2014-12-30 17:36:06 (GMT)
commit058f23a24104bd1f6dc55ae34e35dd61004f0735 (patch)
treeb0306120d003183002fb51c0e8ae335ec62ac6b7
parentd3bc8ffa53d28b23e66f632568191db052fdfef0 (diff)
downloadtk-058f23a24104bd1f6dc55ae34e35dd61004f0735.zip
tk-058f23a24104bd1f6dc55ae34e35dd61004f0735.tar.gz
tk-058f23a24104bd1f6dc55ae34e35dd61004f0735.tar.bz2
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).
-rw-r--r--generic/tkTextDisp.c13
1 files 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);
}