mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
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
12 lines
386 B
TypeScript
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);
|
|
});
|
|
});
|