summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-04-07 20:12:59 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-04-07 20:12:59 (GMT)
commit9d90394ce5a6f65f1dcd75a4b599371fcc613f34 (patch)
tree59e07f7667c43e4a5591027b8827eff688691e27
parent3585f00277a323021e20947cc844ea3d09c241a2 (diff)
downloadtk-9d90394ce5a6f65f1dcd75a4b599371fcc613f34.zip
tk-9d90394ce5a6f65f1dcd75a4b599371fcc613f34.tar.gz
tk-9d90394ce5a6f65f1dcd75a4b599371fcc613f34.tar.bz2
Fix wordstart modifier for UTF-8 text - Bug [562118ce41]
-rw-r--r--generic/tkTextIndex.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 13f3957..7cb71bb 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2369,11 +2369,20 @@ StartEnd(
}
firstChar = 0;
}
- offset -= chSize;
- indexPtr->byteIndex -= chSize;
+ if (offset == 0) {
+ if (modifier == TKINDEX_DISPLAY) {
+ TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr,
+ COUNT_DISPLAY_INDICES);
+ } else {
+ TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr,
+ COUNT_INDICES);
+ }
+ } else {
+ indexPtr->byteIndex -= chSize;
+ }
+ offset -= chSize;
if (offset < 0) {
- if (indexPtr->byteIndex < 0) {
- indexPtr->byteIndex = 0;
+ if (indexPtr->byteIndex == 0) {
goto done;
}
segPtr = TkTextIndexToSeg(indexPtr, &offset);