engine: a key that converts nothing is the application's

Space and Tab convert a Japanese reading, and a reading with no
candidate to step through was committed and the key eaten.  Katakana
mode converts nothing -- katakouho adds the Katakana form only when it
differs from the reading, and in Katakana mode it never does -- so
every Space between two Katakana words was swallowed and had to be
typed twice: カク<Space> committed カク and left no space, and the
second Space passed through only because nothing was pending any more.

Committing and passing the key on gives the space back.  Hiragana is
unchanged wherever the reading has kana, since the Katakana form is
always one candidate there; it changes only for a reading that made no
kana at all, かx<Space>, which now commits and spaces too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 13:56:19 +09:00
parent d9e27e8b01
commit dab80b3a77
3 changed files with 19 additions and 5 deletions

View File

@@ -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))){