fix(frontends): restart preedit around commits
This commit is contained in:
@@ -420,25 +420,38 @@ engine_active_owner_caret(struct ct *t)
|
||||
void
|
||||
engine_commit_contract(struct ct *t)
|
||||
{
|
||||
static const struct {
|
||||
Rune key;
|
||||
char *one;
|
||||
char *all;
|
||||
} cases[] = {
|
||||
{ 'z', "ㅋ", "ㅋㅋㅋ" },
|
||||
{ 'r', "ㄱ", "ㄱㄱㄱ" },
|
||||
{ 'd', "ㅇ", "ㅇㅇㅇ" },
|
||||
{ 'k', "ㅏ", "ㅏㅏㅏ" },
|
||||
};
|
||||
Keyres res;
|
||||
Str all, com;
|
||||
char owner;
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&all);
|
||||
for(i = 0; i < 3; i++){
|
||||
res = ownerrequestcap(&owner, Cclientpreedit,
|
||||
Keypress, 'z', 0);
|
||||
CT_CHECK(t, res.eaten);
|
||||
checkstr(t, "repeated consonant commit",
|
||||
i == 0 ? "" : "ㅋ", &res.commit);
|
||||
checkstr(t, "repeated consonant preedit", "ㅋ", &res.preedit);
|
||||
sappend(&all, &res.commit);
|
||||
for(j = 0; j < nelem(cases); j++){
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&all);
|
||||
for(i = 0; i < 3; i++){
|
||||
res = ownerrequestcap(&owner, Cclientpreedit,
|
||||
Keypress, cases[j].key, 0);
|
||||
CT_CHECK(t, res.eaten);
|
||||
checkstr(t, "repeated jamo commit",
|
||||
i == 0 ? "" : cases[j].one, &res.commit);
|
||||
checkstr(t, "repeated jamo preedit", cases[j].one,
|
||||
&res.preedit);
|
||||
sappend(&all, &res.commit);
|
||||
}
|
||||
sappend(&all, &res.preedit);
|
||||
checkstr(t, "repeated jamo total", cases[j].all, &all);
|
||||
}
|
||||
sappend(&all, &res.preedit);
|
||||
checkstr(t, "repeated consonant total", "ㅋㅋㅋ", &all);
|
||||
|
||||
init();
|
||||
im.l = getlang(LangJP);
|
||||
|
||||
Reference in New Issue
Block a user