fix(engine): keep composing when a reading reaches Maxrunes
At the limit the key that did not fit was handed back to the client as plain ASCII, so a long Japanese reading ended in a Latin letter, and a pending romaji consonant was flushed as ASCII with it (…あka for か). Commit the completed kana, keep the pending syllable, and transliterate the key as usual; other languages commit and go on the same way.
This commit is contained in:
10
strans.c
10
strans.c
@@ -751,9 +751,13 @@ transition(u32int ks, u32int mod, Str *com)
|
||||
return 0;
|
||||
if(im.pre.n >= Maxrunes ||
|
||||
(isjp(&im) && im.pre.n + im.raw.n >= Maxrunes)){
|
||||
commit(com);
|
||||
reset();
|
||||
return 0;
|
||||
/* A full reading commits; a pending romaji syllable stays. */
|
||||
if(isjp(&im))
|
||||
sappend(com, &im.pre);
|
||||
else
|
||||
commit(com);
|
||||
sclear(&im.pre);
|
||||
clearkouho();
|
||||
}
|
||||
return dotrans(ks, com);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user