pi-mono/packages/tui/test/text.test.ts
Armin Ronacher 0f21a3319d fix(coding-agent,tui): reuse syntax highlighting and rendered Markdown blocks
Codemode and write rows keep their last highlighting in a CodeHighlighter
that checks theme and grammar changes itself. Markdown reuses the top-level
blocks of its last render, held weakly, and assistant messages reuse their
Markdown instances while streaming. Text.setText() keeps its wrapped lines
for unchanged text.

closes #10971
2026-11-01 14:40:56 +01:00

12 lines
386 B
TypeScript

import assert from "node:assert";
import { describe, it } from "node:test";
import { Text } from "../src/components/text.ts";
describe("Text", () => {
it("keeps its wrapped lines when the same text is set again", () => {
const text = new Text("hello world", 0, 0);
const lines = text.render(5);
text.setText("hello world");
assert.strictEqual(text.render(5), lines);
});
});