summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 946c543..5c44935 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4828,7 +4828,8 @@ TextRedrawTag(
* the line containing the previous character.
*/
- if (curIndexPtr->byteIndex == 0) {
+ if ((curIndexPtr->byteIndex == 0)
+ && !TkTextIsElided(textPtr, curIndexPtr, NULL)) {
dlPtr = FindDLine(textPtr, dlPtr, curIndexPtr);
} else {
TkTextIndex tmp;
@@ -5084,7 +5085,8 @@ TkTextSetYView(
*/
textPtr->topIndex = *indexPtr;
- if (indexPtr->byteIndex != 0) {
+ if (!(indexPtr->byteIndex == 0
+ && !TkTextIsElided(textPtr, indexPtr, NULL))) {
TkTextFindDisplayLineEnd(textPtr, &textPtr->topIndex, 0, NULL);
}
dInfoPtr->newTopPixelOffset = pickPlace;
@@ -6227,13 +6229,11 @@ GetYPixelCount(
/*
* For the common case where this dlPtr is also the start of the logical
- * line, we can return right away. Note the implicit assumption here that
- * the start of a logical line is always the start of a display line (if
- * the 'elide won't elide first newline' bug is fixed, this will no longer
- * necessarily be true).
+ * line, we can return right away.
*/
- if (dlPtr->index.byteIndex == 0) {
+ if ((dlPtr->index.byteIndex == 0)
+ && !TkTextIsElided(textPtr, &dlPtr->index, NULL)) {
return count;
}
@@ -6543,26 +6543,26 @@ FindDLine(
*/
while (TkTextIndexCmp(&dlPtr->index,indexPtr) < 0) {
- dlPtrPrev = dlPtr;
- dlPtr = dlPtr->nextPtr;
- if (dlPtr == NULL) {
- /*
- * We're past the last display line, either because the desired
- * index lies past the visible text, or because the desired index
- * is on the last display line showing the last logical line.
- */
- indexPtr2 = dlPtrPrev->index;
- TkTextFindDisplayLineEnd(textPtr, &indexPtr2, 1, NULL);
- if (TkTextIndexCmp(&indexPtr2,indexPtr) >= 0) {
- dlPtr = dlPtrPrev;
- break;
- } else {
- return NULL;
- }
+ dlPtrPrev = dlPtr;
+ dlPtr = dlPtr->nextPtr;
+ if (dlPtr == NULL) {
+ /*
+ * We're past the last display line, either because the desired
+ * index lies past the visible text, or because the desired index
+ * is on the last display line showing the last logical line.
+ */
+ indexPtr2 = dlPtrPrev->index;
+ TkTextFindDisplayLineEnd(textPtr, &indexPtr2, 1, NULL);
+ if (TkTextIndexCmp(&indexPtr2,indexPtr) >= 0) {
+ dlPtr = dlPtrPrev;
+ break;
+ } else {
+ return NULL;
+ }
}
if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) {
dlPtr = dlPtrPrev;
- break;
+ break;
}
}