summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2024-02-03 11:05:54 (GMT)
committerfvogel <fvogelnew1@free.fr>2024-02-03 11:05:54 (GMT)
commit3b3f7ed808224bd5ca953b2ea16409be56195438 (patch)
tree6c735f991a9c41d15b90fd1f939eb91b2d3c5002
parent741e561bf1a9018ec741c6a638a73136ca56021c (diff)
downloadtk-3b3f7ed808224bd5ca953b2ea16409be56195438.zip
tk-3b3f7ed808224bd5ca953b2ea16409be56195438.tar.gz
tk-3b3f7ed808224bd5ca953b2ea16409be56195438.tar.bz2
Fix [57b821d2db]: text index {insert wordstart} fails at 0 and 1 word start positions.
-rw-r--r--generic/tkTextIndex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index cb7ba7b..272f234 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2438,6 +2438,9 @@ StartEnd(
firstChar = 0;
}
if (offset == 0) {
+ if (indexPtr->byteIndex == 0) {
+ goto done;
+ }
if (modifier == TKINDEX_DISPLAY) {
TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr,
COUNT_DISPLAY_INDICES);
@@ -2450,9 +2453,6 @@ StartEnd(
}
offset -= chSize;
if (offset < 0) {
- if (indexPtr->byteIndex == 0) {
- goto done;
- }
segPtr = TkTextIndexToSeg(indexPtr, &offset);
}
}