diff options
Diffstat (limited to 'core/body_layer.zig')
| -rw-r--r-- | core/body_layer.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/body_layer.zig b/core/body_layer.zig index a1d76784..dbfd7067 100644 --- a/core/body_layer.zig +++ b/core/body_layer.zig @@ -1488,7 +1488,9 @@ test "a selection that is the current place is drawn as the current place, its s const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); defer p.deinit(); colors.setThemeIndex(p, colors.themeIndex("orchard").?); - const pane = try p.setTestFile("alpha beta\ngamma alpha\nb\n"); + // Its first line under the `/` field's row (UX DESIGN M2), the places + // on the lines after it. + const pane = try p.setTestFile("zero\nalpha beta\ngamma alpha\nb\n"); const c = p.chrome(); var frame: std.heap.ArenaAllocator = .init(std.testing.allocator); defer frame.deinit(); @@ -1505,7 +1507,7 @@ test "a selection that is the current place is drawn as the current place, its s try std.testing.expectEqual(@as(?usize, 0), pane.places.current); var s = try p.render(frame.allocator()); for (0..5) |i| { - const cell = s.at(x + @as(u16, @intCast(i)), y).style; + const cell = s.at(x + @as(u16, @intCast(i)), y + 1).style; try std.testing.expectEqual(Color{ .rgb = c.hit_current }, cell.bg); try std.testing.expectEqual(Color{ .rgb = c.hit_current_text }, cell.fg); } @@ -1515,10 +1517,10 @@ test "a selection that is the current place is drawn as the current place, its s keys(p, "n"); try std.testing.expectEqual(@as(?usize, 1), pane.places.current); s = try p.render(frame.allocator()); - for (6..11) |i| try std.testing.expectEqual(Color{ .rgb = c.hit_current }, s.at(x + @as(u16, @intCast(i)), y + 1).style.bg); - try std.testing.expect(s.cursor != null and s.cursor.?.y == y + 1 and s.cursor.?.x >= x + 6 and s.cursor.?.x <= x + 10); + for (6..11) |i| try std.testing.expectEqual(Color{ .rgb = c.hit_current }, s.at(x + @as(u16, @intCast(i)), y + 2).style.bg); + try std.testing.expect(s.cursor != null and s.cursor.?.y == y + 2 and s.cursor.?.x >= x + 6 and s.cursor.?.x <= x + 10); // The line selected, past the place: a selection again. keys(p, "x"); s = try p.render(frame.allocator()); - try std.testing.expectEqual(Color{ .rgb = c.page.selection.ground }, s.at(x + 6, y + 1).style.bg); + try std.testing.expectEqual(Color{ .rgb = c.page.selection.ground }, s.at(x + 6, y + 2).style.bg); } |
