summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-01-24 14:58:03 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-01-24 14:58:03 (GMT)
commit43202bdf5b7678279ad57e69854c36c6a6e8c72d (patch)
tree756feba5ca87ddf98ea57401e90da2be2dbdd405 /generic/tkTextDisp.c
parent6e70d0c9924222b58ed4e45ca85bdc52104ed4e4 (diff)
downloadtk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.zip
tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.tar.gz
tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.tar.bz2
TkTextIndexCount is counting chars. Fix these calls where bytes counting is needed. Among other issues, this fixes horizontal scrolling when typing text at the end of a line containing multi-byte characters.
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index a6ab13c..34202bd 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3465,8 +3465,8 @@ TkTextFindDisplayLineEnd(
*/
*xOffset = DlineXOfIndex(textPtr, dlPtr,
- TkTextIndexCount(textPtr, &dlPtr->index, indexPtr,
- COUNT_INDICES));
+ TkTextIndexCountBytes(textPtr, &dlPtr->index,
+ indexPtr));
}
if (end) {
/*
@@ -5549,8 +5549,7 @@ TkTextSeeCmd(
* they are elided.
*/
- byteCount = TkTextIndexCount(textPtr, &dlPtr->index, &index,
- COUNT_INDICES);
+ byteCount = TkTextIndexCountBytes(textPtr, &dlPtr->index, &index);
for (chunkPtr = dlPtr->chunkPtr; chunkPtr != NULL ;
chunkPtr = chunkPtr->nextPtr) {
if (byteCount < chunkPtr->numBytes) {
@@ -7078,8 +7077,7 @@ TkTextIndexBbox(
* they are elided.
*/
- byteCount = TkTextIndexCount(textPtr, &dlPtr->index, indexPtr,
- COUNT_INDICES);
+ byteCount = TkTextIndexCountBytes(textPtr, &dlPtr->index, indexPtr);
for (chunkPtr = dlPtr->chunkPtr; ; chunkPtr = chunkPtr->nextPtr) {
if (chunkPtr == NULL) {
return -1;