fix(tui): handle Thai Sara Am width

closes #3904
This commit is contained in:
Mario Zechner
2026-04-29 22:58:00 +02:00
parent ae81deb4c3
commit bc668826ed
4 changed files with 36 additions and 1 deletions

View File

@@ -626,6 +626,18 @@ describe("Editor component", () => {
}
});
it("renders isolated Thai and Lao AM clusters without width drift", () => {
for (const text of ["ำabc", "ຳabc"]) {
const editor = new Editor(createTestTUI(), defaultEditorTheme);
const width = 8;
editor.setText(text);
for (const line of editor.render(width)) {
assert.strictEqual(visibleWidth(line), width, `line width drift for ${JSON.stringify(text)}: ${line}`);
}
}
});
it("wraps CJK characters correctly (each is 2 columns wide)", () => {
const editor = new Editor(createTestTUI(), defaultEditorTheme);
const width = 10 + 1; // +1 col reserved for cursor