mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 03:03:42 +00:00
fix(tui): stabilize regional indicator width to prevent streaming render drift (#1783)
This commit is contained in:
parent
d4084a7ad6
commit
85d06052fb
4 changed files with 68 additions and 0 deletions
|
|
@ -111,6 +111,11 @@ describe("wrapTextWithAnsi", () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("should treat isolated regional indicators as width 2", () => {
|
||||
assert.strictEqual(visibleWidth("🇨"), 2);
|
||||
assert.strictEqual(visibleWidth("🇨🇳"), 2);
|
||||
});
|
||||
|
||||
it("should truncate trailing whitespace that exceeds width", () => {
|
||||
const twoSpacesWrappedToWidth1 = wrapTextWithAnsi(" ", 1);
|
||||
assert.ok(visibleWidth(twoSpacesWrappedToWidth1[0]) <= 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue