engine: one trans contract for every language

Japanese was never dispatched through the Lang table: dotrans and
transstr both special-cased it into transjp, which edited Im in place
and wrote commits through a side argument, while transko popped and
cleared a pre that every caller overwrote anyway, and Vietnamese kept
its key history in dotrans. Emit now carries the new raw state next to
the new pre; transjp, transko and transvi are pure functions of (Im,
key), and dotrans and transstr have a single path. Vietnamese history
bookkeeping lives in vi.c, where the full-history flush no longer
resets the caret as a side effect; istone was toneidx() >= 0.
This commit is contained in:
2026-08-16 16:04:57 +09:00
parent abaea77248
commit a557fb114a
5 changed files with 118 additions and 118 deletions

View File

@@ -15,6 +15,7 @@ typevi(struct ct *t, char *keys, char *want)
e = transvi(&state, (uchar)*p);
sappend(&out, &e.s);
state.pre = e.next;
state.raw = e.raw;
if(!e.eat)
sputr(&out, (uchar)*p);
}