fix: trim trailing whitespace per line in paint output to match Ink behavior
Ink's Output.get() calls .trimEnd() on each line of the rendered grid.
Without this, vue-tui's paint grid always fills the full root width with
spaces, causing raw frame output to contain 100-char-wide padding. This
broke tests using { raw: true } and made meaningful trailing-space
assertions impossible with { trimLines: true }.
Also corrects test assertions for 'set width in percent' and 'relative
position' that expected trailing spaces which Ink never produces.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ test("relative position offsets visual position while keeping flow", async () =>
|
||||
)),
|
||||
{ columns: 100 },
|
||||
);
|
||||
expect(lastFrame({ trimLines: true })).toBe(" BA ");
|
||||
expect(lastFrame({ trimLines: true })).toBe(" BA");
|
||||
});
|
||||
|
||||
test("static position ignores offsets", async () => {
|
||||
|
||||
@@ -30,7 +30,7 @@ test("set width in percent", async () => {
|
||||
)),
|
||||
{ columns: 100 },
|
||||
);
|
||||
expect(lastFrame({ trimLines: true })).toBe("A B ");
|
||||
expect(lastFrame({ trimLines: true })).toBe("A B");
|
||||
});
|
||||
|
||||
test("set min width", async () => {
|
||||
|
||||
Reference in New Issue
Block a user