engine: trim the key dispatch
mapget and maplookup were one trie probe with two predicates; mapmatch returns the match kind and mapget is its exact case. movedelta is a switch. searchkey's modifier test was unreachable behind transition's, searchlang's Alt/Super test behind both callers' earlier returns, and picksearch's range check behind numberedkouho. Korean key folding runs once at the top of transition. commit() on an empty preedit is a no-op, so the Ctrl branch and startsearch lose their haspre guards and repeated commit/reset pairs. Ctrl+language inside a search now commits the shown query as it does elsewhere instead of dropping it. Language ids are documented as the Ctrl codes they are; Im parameters no longer shadow the file's Im.
This commit is contained in:
@@ -1570,6 +1570,17 @@ engine_emoji_start_and_unknown(struct ct *t)
|
||||
CT_EQ_INT(t, LangKO, im.l->lang);
|
||||
}
|
||||
|
||||
/* A language switch commits the query like any other pending text. */
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke('e', Mctrl, &com));
|
||||
if(typekeys(t, "xy", &com)){
|
||||
CT_CHECK(t, keystroke('t', Mctrl, &com));
|
||||
checkstr(t, "language switch commits query", "xy", &com);
|
||||
CT_CHECK(t, !search.lang);
|
||||
CT_EQ_INT(t, LangEN, im.l->lang);
|
||||
im.l = getlang(LangKO);
|
||||
}
|
||||
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke('e', Mctrl, &com));
|
||||
for(i = 0; i < Maxrunes; i++)
|
||||
|
||||
Reference in New Issue
Block a user