From 47f9801ad88cb165a65e5075c78ea4ce567fb23a Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 17 Aug 2026 01:45:27 +0900 Subject: [PATCH] engine: a search just begun shows itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ctrl+E and Ctrl+H gave no sign until a key produced candidates; with nothing pending the popup even went away. An empty search now shows ☺ or 漢 in the popup, so the user knows the next keys are a query. --- README.md | 3 ++- strans.c | 2 ++ tests/engine_test.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0aaf930..4bbbc7e 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,8 @@ Hiragana mode composes a complete reading before offering Kanji candidates. Katakana mode does not perform Kanji conversion. Emoji and Hanja searches return to the previous mode after use; switching language during a search commits the shown query; `Esc` in a Hanja search gives the syllable back -to the composition. The Emoji search matches the typed keys, and what +to the composition. A search with nothing typed yet shows ☺ or 漢 in the +popup. The Emoji search matches the typed keys, and what they spell in the current language, against a prefix of every emoji's CLDR name and keywords in English, Korean, and Japanese, and against ASCII symbol aliases such as `->` and `<=`. `Ctrl+H` takes the syllable being composed as its diff --git a/strans.c b/strans.c index 80cade3..ea9ba16 100644 --- a/strans.c +++ b/strans.c @@ -192,6 +192,8 @@ snapshot(Drawcmd *dc) impre(&im, &pre); if(!(activecap & Cclientpreedit)) dc->pre = pre; + if(search.lang && pre.n == 0) /* a search just begun shows itself */ + sputr(&dc->pre, search.lang == LangEMOJI ? L'☺' : L'漢'); first = pagefirst(); n = im.nkouho - first; if(n > Maxdisp) n = Maxdisp; diff --git a/tests/engine_test.c b/tests/engine_test.c index 383cdb1..ecec12a 100644 --- a/tests/engine_test.c +++ b/tests/engine_test.c @@ -1359,6 +1359,8 @@ engine_emoji_single_candidate(struct ct *t) CT_CHECK(t, keystroke('e', Mctrl, &com)); CT_CHECK(t, search.lang); CT_EQ_INT(t, LangKO, im.l->lang); + if(CT_CHECK(t, draindraw(&dc) > 0)) + checkstr(t, "empty search shows itself", "☺", &dc.pre); if(typekeys(t, "alpha", &com)){ checkstr(t, "no automatic commit", "", &com); checkstr(t, "raw English query", "alpha", &search.text);