diff options
author | fvogel <fvogelnew1@free.fr> | 2021-04-17 13:28:40 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2021-04-17 13:28:40 (GMT) |
commit | ad62abdbadab35439f45dcb00a2cce9f18526da6 (patch) | |
tree | 282eded789366cbe065ce5e34fa0e2dea62cc1b1 /generic | |
parent | 4326a851599c3a7f651a1731ed5366d01043e16f (diff) | |
download | tk-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.c | 14 |
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); } } |