summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-01-24 14:58:03 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-01-24 14:58:03 (GMT)
commit662480c9ebe208020fd0484bbd7908dbb0fa7562 (patch)
treef38ea602db1991d6f158b487369145dfa7ac873f /generic/tkTextDisp.c
parent2a1df1da7fd04bf2163249f588314d1ae33d12f5 (diff)
downloadtk-662480c9ebe208020fd0484bbd7908dbb0fa7562.zip
tk-662480c9ebe208020fd0484bbd7908dbb0fa7562.tar.gz
tk-662480c9ebe208020fd0484bbd7908dbb0fa7562.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;