engine: Ctrl+H converts the pending syllable; Backspace on an empty search stays put

Ctrl+H committed the syllable being composed and opened an empty search,
so converting 한 meant typing it twice; the pending syllable now seeds the
query. Backspace on an already empty search ended it and then reached the
application, deleting a character; it now only ends the search.
This commit is contained in:
2026-08-16 21:30:16 +09:00
parent 5e72a48c2c
commit 91b3e538f1
3 changed files with 48 additions and 24 deletions

View File

@@ -1744,15 +1744,20 @@ engine_hanja_backspace(struct ct *t)
CT_CHECK(t, keystroke(Kback, 0, &com));
checkstr(t, "empty Hanja search", "", &search.text);
CT_EQ_INT(t, LangHANJA, search.lang);
CT_CHECK(t, !keystroke(Kback, 0, &com));
CT_CHECK(t, keystroke(Kback, 0, &com));
CT_EQ_INT(t, 0, search.lang);
/* Ctrl+H converts the pending syllable: it seeds the query. */
if(!typekeys(t, "gks", &com))
goto cleanup;
CT_CHECK(t, keystroke('h', Mctrl, &com));
checkstr(t, "preedit committed before Hanja", "", &com);
checkstr(t, "nothing committed before Hanja", "", &com);
checkstr(t, "pending syllable is the query", "", &search.text);
CT_EQ_INT(t, 2, im.nkouho);
CT_CHECK(t, keystroke(Kback, 0, &com));
checkstr(t, "seed backspaced", "", &search.text);
CT_EQ_INT(t, LangHANJA, search.lang);
CT_CHECK(t, !keystroke(Kback, 0, &com));
CT_CHECK(t, keystroke(Kback, 0, &com));
CT_EQ_INT(t, 0, search.lang);
CT_EQ_INT(t, LangKO, im.l->lang);
cleanup: