From c3e3cbaaee37fcfebc0370250149f50882fa0dd7 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Fri, 16 Aug 2024 10:07:49 +0700 Subject: [PATCH] fix(web): fix malformed reversion display strings Fixes: #12199 --- common/web/lm-worker/src/main/model-compositor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/web/lm-worker/src/main/model-compositor.ts b/common/web/lm-worker/src/main/model-compositor.ts index 39a6add834a..c6b8367b782 100644 --- a/common/web/lm-worker/src/main/model-compositor.ts +++ b/common/web/lm-worker/src/main/model-compositor.ts @@ -225,7 +225,7 @@ export class ModelCompositor { // Handles display string for reversions triggered by accepting a suggestion mid-token. const preCaretToken = postContextTokenization.left[postContextTokenization.left.length - 1]; revertedPrefix = (preCaretToken && !preCaretToken.isWhitespace) ? preCaretToken.text : ''; - revertedPrefix += postContextTokenization.caretSplitsToken ? postContextTokenization.right[0] : ''; + revertedPrefix += postContextTokenization.caretSplitsToken ? postContextTokenization.right[0].text : ''; } else { revertedPrefix = this.wordbreak(postContext); }