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:
4
strans.c
4
strans.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user