diff options
Diffstat (limited to 'src/terminal.zig')
| -rw-r--r-- | src/terminal.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/terminal.zig b/src/terminal.zig index 2bd41030..04e4f233 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -3316,8 +3316,8 @@ inline fn kittyTransmit(comptime extra: []const u8) []const u8 { }; } -fn imagePlaces(s: *const Surface) []const ?pardes.ImagePlace { - return s.images[0..s.nimages]; +fn imagePlaces(s: *const Surface) []const pardes.ImagePlace { + return s.images.items; } test "a terminal's kitty graphics image is drawn where its program placed it, and a delete takes it away" { @@ -3336,7 +3336,7 @@ test "a terminal's kitty graphics image is drawn where its program placed it, an var s = try p.render(frame.allocator()); const places = imagePlaces(s); try std.testing.expectEqual(@as(usize, 1), places.len); - const place = places[0].?; + const place = places[0]; const r = p.rects[0]; try std.testing.expect(place.native.exact); try std.testing.expectEqual(@as(u32, 7), place.native.page); @@ -3356,7 +3356,7 @@ test "a terminal's kitty graphics image is drawn where its program placed it, an p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[24;1H\n\n" } }); _ = frame.reset(.retain_capacity); s = try p.render(frame.allocator()); - try std.testing.expectEqual(p.bodyTop(pane, r), imagePlaces(s)[0].?.y); + try std.testing.expectEqual(p.bodyTop(pane, r), imagePlaces(s)[0].y); p.update(.{ .output = .{ .pane = 0, .bytes = "\n" } }); _ = frame.reset(.retain_capacity); s = try p.render(frame.allocator()); @@ -3472,9 +3472,9 @@ test "a virtual kitty placement shows through its placeholder cells, which draw const r = p.rects[0]; const tx = r.x + config.GUTTER; const y = p.bodyTop(pane, r) + 1; - try std.testing.expectEqual(tx + 2, places[0].?.x); - try std.testing.expectEqual(y, places[0].?.y); - try std.testing.expectEqual(@as(u16, 2), places[0].?.w); + try std.testing.expectEqual(tx + 2, places[0].x); + try std.testing.expectEqual(y, places[0].y); + try std.testing.expectEqual(@as(u16, 2), places[0].w); try std.testing.expectEqualStrings(" ", s.at(tx + 2, y).grapheme()); try std.testing.expectEqualStrings(" ", s.at(tx + 3, y).grapheme()); try std.testing.expectEqualStrings("X", s.at(tx + 4, y).grapheme()); |
