summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gmdocument.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 22f409a6..2f4c7972 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -2074,8 +2074,11 @@ iRangecc findLoc_GmRun(const iGmRun *d, iInt2 pos) {
2074 iRangecc loc; 2074 iRangecc loc;
2075 tryAdvanceNoWrap_Text(d->textParams.font, d->text, x, &loc.start); 2075 tryAdvanceNoWrap_Text(d->textParams.font, d->text, x, &loc.start);
2076 loc.end = loc.start; 2076 loc.end = loc.start;
2077 if (!contains_Range(&d->text, loc.start)) {
2078 return iNullRange; /* it's some other text */
2079 }
2077 iChar ch; 2080 iChar ch;
2078 if (d->text.end != loc.start) { 2081 if (d->text.end && d->text.end != loc.start) {
2079 int chLen = decodeBytes_MultibyteChar(loc.start, d->text.end, &ch); 2082 int chLen = decodeBytes_MultibyteChar(loc.start, d->text.end, &ch);
2080 if (chLen > 0) { 2083 if (chLen > 0) {
2081 /* End after the character. */ 2084 /* End after the character. */