diff --git a/README.md b/README.md index c68633b..c834a94 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ kana shown, and romaji that made no kana stays as typed until it is mended; The dictionary keys verbs and adjectives by stem and okurigana, so `kaku` offers かく's readings and then 書く and its kin — typing the okurigana with `Shift`, as SKK does, `kaKu`, asks for that split first. Katakana -mode does not convert. +mode does not convert, so there `Space` and `Tab` commit the reading and +go on to the application. Korean composes one syllable at a time. `Enter`, `Tab`, `Esc` and any key that is not a jamo commit the syllable and go on to the application, so diff --git a/strans.c b/strans.c index f390ed9..6648f5f 100644 --- a/strans.c +++ b/strans.c @@ -871,12 +871,15 @@ transition(u32int ks, u32int mod, Str *com) if((ks == ' ' || ks == Ktab) && isjp(&im) && haspre(&im) && !(mod & ~Mshift)){ /* Space and Tab convert: they step through the candidates, - * Katakana last; a reading with none is committed. */ + * Katakana last. Katakana mode converts nothing, so there + * the key only commits, and then it is the application's: + * the space between two Katakana words is a space. */ katakouho(); - if(im.nkouho != 0) - cyclekouho(mod & Mshift ? -1 : 1); - else + if(im.nkouho == 0){ flush(com); + return 0; + } + cyclekouho(mod & Mshift ? -1 : 1); return 1; } if(ks == Ktab || ks == Kret || (ks == Kesc && !isjp(&im))){ diff --git a/tests/engine_test.c b/tests/engine_test.c index ec635c2..3ac0e75 100644 --- a/tests/engine_test.c +++ b/tests/engine_test.c @@ -1441,6 +1441,16 @@ engine_katakana_sequences(struct ct *t) checkstr(t, "committed Katakana", cases[i].want, &com); } CT_EQ_PTR(t, nil, getlang(LangJPK)->dictname); + + /* Nothing to convert to: the key commits and goes on to the client. */ + init(); + im.l = getlang(LangJPK); + sclear(&com); + if(typekeys(t, "kaku", &com)){ + CT_CHECK(t, !keystroke(' ', 0, &com)); + checkstr(t, "Space commits the Katakana", "カク", &com); + CT_EQ_INT(t, 0, im.nkouho); + } } void