summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-19 14:02:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-19 14:02:02 (GMT)
commit51d384bfda7a3eb5a915b19d343c8bb657268d75 (patch)
tree5d397a27a26ba1f1486439d759196d0528f83248 /generic/tkTextIndex.c
parent5204a77ccd7306b8ed7c3c264c88171f68180efd (diff)
downloadtk-51d384bfda7a3eb5a915b19d343c8bb657268d75.zip
tk-51d384bfda7a3eb5a915b19d343c8bb657268d75.tar.gz
tk-51d384bfda7a3eb5a915b19d343c8bb657268d75.tar.bz2
New (internal) function TkUtfPrev(). This function can handle 4-byte (illegal) byte-sequences, arising when pasting Emoji on a Text widget on MacOS (for example)
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 056902a..8f30b7d 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -436,7 +436,7 @@ TkTextMakeByteIndex(
*/
start = segPtr->body.chars + (byteIndex - index);
- p = Tcl_UtfPrev(start, segPtr->body.chars);
+ p = TkUtfPrev(start, segPtr->body.chars);
p += TkUtfToUniChar(p, &ch);
indexPtr->byteIndex += p - start;
}
@@ -2125,7 +2125,7 @@ TkTextIndexBackChars(
if (segPtr->typePtr == &tkTextCharType) {
start = segPtr->body.chars;
end = segPtr->body.chars + segSize;
- for (p = end; ; p = Tcl_UtfPrev(p, start)) {
+ for (p = end; ; p = TkUtfPrev(p, start)) {
if (charCount == 0) {
dstPtr->byteIndex -= (end - p);
goto backwardCharDone;
@@ -2366,7 +2366,7 @@ StartEnd(
}
if (offset > 0) {
chSize = (segPtr->body.chars + offset
- - Tcl_UtfPrev(segPtr->body.chars + offset,
+ - TkUtfPrev(segPtr->body.chars + offset,
segPtr->body.chars));
}
firstChar = 0;