fix(engine): movement keys without candidates commit the pending text

Up, Down, PageUp and PageDown with a composition pending and nothing to
move through returned the key uneaten but left the text pending, so the
client moved its cursor and reset the context: the pending Korean
syllable vanished, where Left or Home would have committed it. Let them
fall through to the special-key path that commits and passes the key.
This commit is contained in:
2026-08-16 20:26:28 +09:00
parent 9853d65d4c
commit 6402c26830
2 changed files with 11 additions and 3 deletions

View File

@@ -671,9 +671,7 @@ transition(u32int ks, u32int mod, Str *com)
if(search.lang)
return searchkey(ks, mod, com);
n = movedelta(ks);
if(n != 0){
if(im.nkouho == 0)
return 0;
if(n != 0 && im.nkouho != 0){
movekouho(n);
return 1;
}

View File

@@ -454,6 +454,16 @@ engine_commit_contract(struct ct *t)
CT_EQ_INT(t, 0, im.nkouho);
CT_EQ_INT(t, -1, im.sel);
/* Without candidates the movement keys commit like any other. */
init();
im.l = getlang(LangKO);
sclear(&com);
if(!typekeys(t, "dy", &com))
return;
CT_CHECK(t, !keystroke(Kdown, 0, &com));
checkstr(t, "arrow commit", "", &com);
CT_EQ_INT(t, 0, im.pre.n);
init();
im.l = getlang(LangJP);
sclear(&com);