engine: Korean and Telex let Enter and Tab through after committing

Enter with a pending syllable committed it and stopped there, so a chat
message needed Enter twice; Korean input methods commit and pass the key
on. Japanese keeps consuming the key that confirms a reading or a chosen
candidate, as Japanese input methods do.
This commit is contained in:
2026-08-16 21:28:11 +09:00
parent 11bf379ad3
commit 5e72a48c2c
3 changed files with 15 additions and 10 deletions

View File

@@ -56,7 +56,7 @@ vietnamese_state_lifetime(struct ct *t)
im.pre = mkstr("as");
im.raw = mkstr("as");
sclear(&com);
CT_CHECK(t, keystroke(Kret, 0, &com));
CT_CHECK(t, !keystroke(Kret, 0, &com));
checkstr(t, "committed Telex", "á", &com);
CT_EQ_INT(t, 0, im.pre.n);
CT_EQ_INT(t, 0, im.raw.n);
@@ -373,7 +373,7 @@ engine_vietnamese_client_preedit(struct ct *t)
redraw();
if(CT_CHECK(t, draindraw(&dc) > 0))
CT_EQ_INT(t, 0, scmp(&dc.pre, &res.preedit));
CT_CHECK(t, keystroke(Kret, 0, &com));
CT_CHECK(t, !keystroke(Kret, 0, &com));
checkstr(t, "commit", cases[i].shown, &com);
}
}
@@ -615,7 +615,7 @@ engine_language_switch_state(struct ct *t)
{ "switch to Vietnamese", 'v', Mctrl, LangVI, "", "", "", 0 },
{ "Vietnamese a again", 'a', 0, LangVI, "a", "a", "", 0 },
{ "Vietnamese tone again", 's', 0, LangVI, "as", "as", "", 0 },
{ "commit Vietnamese", Kret, 0, LangVI, "", "", "á", 0 },
{ "commit Vietnamese", 't', Mctrl, LangEN, "", "", "á", 0 },
};
char where[80];
Lang *vi;
@@ -730,6 +730,7 @@ static void
candidatebegin(int n)
{
init();
im.l = getlang(LangJP);
draindraw(nil);
setcandidates(n);
}
@@ -887,13 +888,14 @@ engine_candidate_completion(struct ct *t)
CT_CHECK(t, keystroke(Kret, 0, &com));
checkstr(t, "Enter without candidates", "reading", &com);
/* A digit with no such row on the page is an ordinary key. */
candidatebegin(32);
im.pre = mkstr("reading");
im.sel = 27;
sclear(&com);
CT_CHECK(t, !keystroke('9', 0, &com));
checkstr(t, "unavailable short-page digit", "", &com);
CT_EQ_INT(t, 32, im.nkouho);
CT_EQ_INT(t, 27, im.sel);
checkstr(t, "unavailable short-page digit", "reading", &com);
CT_EQ_INT(t, 0, im.nkouho);
}
static void