diff options
author | fvogel <fvogelnew1@free.fr> | 2024-02-08 20:44:40 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2024-02-08 20:44:40 (GMT) |
commit | a1ce70246778a59d90860ddf2e7dcb5df41b3472 (patch) | |
tree | 39643ca8e9f7116e6162403008e3bcb07bf9543a /generic/tkTextIndex.c | |
parent | d499cbcf09e1d2cd39375e41c0762384cab315bf (diff) | |
parent | 1ade324bf42e515369a1d1f123cbb03f31ef5ba2 (diff) | |
download | tk-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.c | 6 |
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); } } |