engine: a romaji typo stays in the reading
A key that could not go on with the pending romaji, when that was not a syllable either, committed the whole reading to the application and passed the key on: one slip dumped かんj into the text with no way back. The letters typed now stay in the reading as they are, like any other IME shows them, and Backspace mends them; only a key that starts no syllable at all still ends the composition.
This commit is contained in:
23
strans.c
23
strans.c
@@ -327,20 +327,21 @@ transjp(Im *p, Rune c)
|
||||
}
|
||||
return e;
|
||||
}
|
||||
if(e.raw.n != 0 && mapget(p->l->map, &e.raw, &mapped)){
|
||||
sappend(&e.next, &mapped);
|
||||
sclear(&e.raw);
|
||||
sclear(&key);
|
||||
sputr(&key, c);
|
||||
if(mapmatch(p->l->map, &key, &mapped) != TrieMiss){
|
||||
e.raw = key;
|
||||
return e;
|
||||
}
|
||||
/* The pending romaji is done: kana if it is complete, else the
|
||||
* letters as typed, for Backspace to mend. */
|
||||
if(!mapget(p->l->map, &e.raw, &mapped))
|
||||
mapped = e.raw;
|
||||
sappend(&e.next, &mapped);
|
||||
sclear(&e.raw);
|
||||
sclear(&key);
|
||||
sputr(&key, c);
|
||||
if(mapmatch(p->l->map, &key, &mapped) != TrieMiss){
|
||||
e.raw = key;
|
||||
return e;
|
||||
}
|
||||
/* The key starts no syllable: flush the reading and pass it on. */
|
||||
jpreading(p->l->map, &e.next, &e.raw, &e.s);
|
||||
e.s = e.next;
|
||||
sclear(&e.next);
|
||||
sclear(&e.raw);
|
||||
e.eat = 0;
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user