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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user