terminal: render state style get requires non-default style

pull/9662/head
Mitchell Hashimoto 2025-11-17 15:10:34 -10:00
parent 789b3dd38d
commit 60fe4af8ac
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 7 additions and 1 deletions

View File

@ -198,7 +198,10 @@ pub const RenderState = struct {
cells.appendAssumeCapacity(.{
.content = .{ .single = page_cell.content.codepoint },
.wide = page_cell.wide,
.style = p.styles.get(p.memory, page_cell.style_id).*,
.style = if (page_cell.style_id > 0) p.styles.get(
p.memory,
page_cell.style_id,
).* else .{},
});
// Switch on our content tag to handle less likely cases.
@ -264,6 +267,9 @@ test {
});
defer t.deinit(alloc);
// This fills the screen up
try t.decaln();
var state: RenderState = .empty;
defer state.deinit(alloc);
try state.update(alloc, &t);