summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
commitd8f50ac067d2f0df387ca0b0c46278c2464efc8b (patch)
tree4c40167ca8b673d38459b4478944b8bc60cc4a7f /generic/tkText.c
parentc56ea97892bf4b5716fd0c88709b0ef0cb130995 (diff)
parenta9827f93eadc2978316098553e09406dae1f5520 (diff)
downloadtk-bug-b1d115fa60.zip
tk-bug-b1d115fa60.tar.gz
tk-bug-b1d115fa60.tar.bz2
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index c41fc67..90ec575 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -3297,7 +3297,7 @@ DeleteIndexRange(
TkTextSetYView(tPtr, &indexTmp, 0);
}
} else {
- TkTextMakeByteIndex(sharedTextPtr->tree, tPtr, line,
+ TkTextMakeByteIndex(sharedTextPtr->tree, NULL, line,
byteIndex, &indexTmp);
/*
* line may be before -startline of tPtr and must be
@@ -3306,20 +3306,12 @@ DeleteIndexRange(
* would be displayed.
* There is no need to worry about -endline however,
* because the view will only be reset if the deletion
- * involves the TOP line of the screen
+ * involves the TOP line of the screen. That said,
+ * the following call adjusts to both.
*/
- if (tPtr->start != NULL) {
- int start;
- TkTextIndex indexStart;
+ TkTextIndexAdjustToStartEnd(tPtr, &indexTmp, 0);
- start = TkBTreeLinesTo(NULL, tPtr->start);
- TkTextMakeByteIndex(sharedTextPtr->tree, NULL, start,
- 0, &indexStart);
- if (TkTextIndexCmp(&indexTmp, &indexStart) < 0) {
- indexTmp = indexStart;
- }
- }
TkTextSetYView(tPtr, &indexTmp, 0);
}
}