mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-31 12:47:43 +00:00
fix(common/models): prevents "undefined" reversion display string
This commit is contained in:
parent
27066c59da
commit
24cbb23622
1 changed files with 5 additions and 1 deletions
|
|
@ -487,7 +487,11 @@ class ModelCompositor {
|
|||
let postContextTokenization = this.tokenize(postContext);
|
||||
if(postContextTokenization) {
|
||||
// Handles display string for reversions triggered by accepting a suggestion mid-token.
|
||||
revertedPrefix = postContextTokenization.left[postContextTokenization.left.length-1];
|
||||
if(postContextTokenization.left.length > 0) {
|
||||
revertedPrefix = postContextTokenization.left[postContextTokenization.left.length-1];
|
||||
} else {
|
||||
revertedPrefix = '';
|
||||
}
|
||||
revertedPrefix += postContextTokenization.caretSplitsToken ? postContextTokenization.right[0] : '';
|
||||
} else {
|
||||
revertedPrefix = this.wordbreak(postContext);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue