terminal: render state style get requires non-default style

This commit is contained in:
Mitchell Hashimoto
2025-11-17 15:10:34 -10:00
parent 789b3dd38d
commit 60fe4af8ac

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);