fix(engine): the search keys commit the query they end or replace

Ctrl+E during an emoji search, Ctrl+H during a hanja search, or either
during the other search dropped the typed query, while every other
Ctrl key committed it as the README says. Escape is the way to cancel;
the search keys now commit the shown text like a language switch.
This commit is contained in:
2026-08-16 20:27:31 +09:00
parent 6402c26830
commit 32a9723043
2 changed files with 30 additions and 16 deletions

View File

@@ -1585,6 +1585,23 @@ engine_emoji_start_and_unknown(struct ct *t)
im.l = getlang(LangKO);
}
/* So do the search keys, ending or changing the search. */
sclear(&com);
CT_CHECK(t, keystroke('e', Mctrl, &com));
if(typekeys(t, "xy", &com)){
CT_CHECK(t, keystroke('e', Mctrl, &com));
checkstr(t, "search key commits query", "xy", &com);
CT_CHECK(t, !search.lang);
}
sclear(&com);
CT_CHECK(t, keystroke('e', Mctrl, &com));
if(typekeys(t, "xy", &com)){
CT_CHECK(t, keystroke('h', Mctrl, &com));
checkstr(t, "other search commits query", "xy", &com);
CT_EQ_INT(t, LangHANJA, search.lang);
CT_CHECK(t, keystroke(Kesc, 0, &com));
}
sclear(&com);
CT_CHECK(t, keystroke('e', Mctrl, &com));
for(i = 0; i < Maxrunes; i++)