summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-04-17 13:28:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-04-17 13:28:40 (GMT)
commitad62abdbadab35439f45dcb00a2cce9f18526da6 (patch)
tree282eded789366cbe065ce5e34fa0e2dea62cc1b1 /generic
parent4326a851599c3a7f651a1731ed5366d01043e16f (diff)
downloadtk-ad62abdbadab35439f45dcb00a2cce9f18526da6.zip
tk-ad62abdbadab35439f45dcb00a2cce9f18526da6.tar.gz
tk-ad62abdbadab35439f45dcb00a2cce9f18526da6.tar.bz2
Avoid code duplication by calling TkTextIndexAdjustToStartEnd().
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index d2a1691..90ec575 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -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);
}
}