summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2024-02-08 20:44:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2024-02-08 20:44:40 (GMT)
commita1ce70246778a59d90860ddf2e7dcb5df41b3472 (patch)
tree39643ca8e9f7116e6162403008e3bcb07bf9543a /generic/tkTextIndex.c
parentd499cbcf09e1d2cd39375e41c0762384cab315bf (diff)
parent1ade324bf42e515369a1d1f123cbb03f31ef5ba2 (diff)
downloadtk-a1ce70246778a59d90860ddf2e7dcb5df41b3472.zip
tk-a1ce70246778a59d90860ddf2e7dcb5df41b3472.tar.gz
tk-a1ce70246778a59d90860ddf2e7dcb5df41b3472.tar.bz2
Fix [57b821d2db]: text index {insert wordstart} fails at 0 and 1 word start positions.
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index ca54c9e..596ee54 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2446,6 +2446,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);
@@ -2458,9 +2461,6 @@ StartEnd(
}
offset -= chSize;
if (offset < 0) {
- if (indexPtr->byteIndex == 0) {
- goto done;
- }
segPtr = TkTextIndexToSeg(indexPtr, &offset);
}
}