summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
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)
commitd9c4d9d8e4a33e5c2db90e104e77753976999e4f (patch)
treeb0306120d003183002fb51c0e8ae335ec62ac6b7 /generic/tkTextDisp.c
parent1ab50143a150f7311fd78f0b0daa62eab222881d (diff)
downloadtk-d9c4d9d8e4a33e5c2db90e104e77753976999e4f.zip
tk-d9c4d9d8e4a33e5c2db90e104e77753976999e4f.tar.gz
tk-d9c4d9d8e4a33e5c2db90e104e77753976999e4f.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).
Diffstat (limited to 'generic/tkTextDisp.c')
-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);
}