engine: an emoji query shows as typed and Space picks

The emoji search folded the keys for its lookup and then showed and
committed the folded copy: SMILE became smile in the text.  And it
showed the transliteration only while that alone matched, so a Korean
query flipped between 웃 and key soup as it grew.  Now the query shown
is the keys while they match anything, else what they type in the
current language, both as typed; only the lookups fold.  Space in a
search picks the highlighted result as Enter does, instead of adding a
space no alias needs.
This commit is contained in:
2026-08-17 01:44:29 +09:00
parent bab40c95a7
commit 0c4271b8b5
3 changed files with 17 additions and 10 deletions

View File

@@ -1526,6 +1526,7 @@ engine_emoji_digit_aliases(struct ct *t)
checkstr(t, "zero alias", "", &com);
sclear(&com);
im.l = getlang(LangEN);
CT_CHECK(t, keystroke('e', Mctrl, &com));
if(typekeys(t, "smile", &com)){
CT_CHECK(t, keystroke('9', 0, &com));
@@ -1582,6 +1583,7 @@ engine_search_candidate_keys(struct ct *t)
Str com;
emojibegin(&f, 0);
im.l = getlang(LangEN);
sclear(&com);
CT_CHECK(t, keystroke('e', Mctrl, &com));
if(typekeys(t, "smile", &com)){
@@ -1709,11 +1711,13 @@ engine_emoji_start_and_unknown(struct ct *t)
sclear(&com);
CT_CHECK(t, keystroke('e', Mctrl, &com));
if(typekeys(t, "xyz", &com)){
/* Keys that match nothing show what they type in the language. */
CT_CHECK(t, !keystroke(Kspec|0x51, 0, &com));
checkstr(t, "special commits shown query", "xyz", &com);
checkstr(t, "special commits shown query", "", &com);
CT_CHECK(t, !search.lang);
CT_EQ_INT(t, LangKO, im.l->lang);
}
im.l = getlang(LangEN);
/* A language switch commits the query like any other pending text. */
sclear(&com);
@@ -1723,7 +1727,6 @@ engine_emoji_start_and_unknown(struct ct *t)
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);
}
/* So do the search keys, ending or changing the search. */