From e9a05af8b8a34717d5a3b54f449d63cb268321e6 Mon Sep 17 00:00:00 2001 From: jahorton Date: Thu, 23 Jan 2020 09:44:30 +0700 Subject: [PATCH] fix(web): Fixes #2516; forgot a few changes in #2477 --- web/source/text/prediction/modelManager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/source/text/prediction/modelManager.ts b/web/source/text/prediction/modelManager.ts index 567b272ed6..d189f35af5 100644 --- a/web/source/text/prediction/modelManager.ts +++ b/web/source/text/prediction/modelManager.ts @@ -33,16 +33,16 @@ namespace com.keyman.text.prediction { constructor(mock: Mock, config: Configuration) { this.left = mock.getTextBeforeCaret(); - this.startOfBuffer = this.left._kmwLength() > config.leftContextCodeUnits; + this.startOfBuffer = this.left._kmwLength() > config.leftContextCodePoints; if(!this.startOfBuffer) { // Our custom substring version will return the last n characters if param #1 is given -n. - this.left = this.left._kmwSubstr(-config.leftContextCodeUnits); + this.left = this.left._kmwSubstr(-config.leftContextCodePoints); } this.right = mock.getTextAfterCaret(); - this.endOfBuffer = this.right._kmwLength() > config.rightContextCodeUnits; + this.endOfBuffer = this.right._kmwLength() > config.leftContextCodePoints; if(!this.endOfBuffer) { - this.right = this.right._kmwSubstr(0, config.rightContextCodeUnits); + this.right = this.right._kmwSubstr(0, config.leftContextCodePoints); } } }