diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/core/Core.zig b/core/Core.zig index a4c1d086..27a0da4f 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -2611,28 +2611,23 @@ test "TreeContext rows in the tag style keep the message rows" { const full_height = p.surface.body_layers[0].viewport.h; try std.testing.expect(p.surface.body_layers[0].rows > full_height); try std.testing.expectEqual(FontRole.tagline, p.surface.body_layers[0].cells[0].style.font_role); + // A message is on the notice row, not over the body: the viewport + // keeps every row it had. _ = Messages.keep(p, .notice, pane.serial, "", "!"); p.sync(); _ = try p.render(p.scratch.allocator()); - // An overlay takes nothing: the message is a chip OVER the body's first - // row, so the viewport keeps every row it had. try std.testing.expectEqual(full_height, p.surface.body_layers[0].viewport.h); + // ...and the leader's chip is an overlay that takes nothing either. const r = p.view().rects[0]; + p.view().prefix = .leader; + p.sync(); + _ = try p.render(p.scratch.allocator()); + try std.testing.expectEqual(full_height, p.surface.body_layers[0].viewport.h); const band = for (p.surface.tagLayers()) |*layer| { if (layer.rows != 0 and layer.kind == .notice) break layer; } else return error.NoNoticeBand; try std.testing.expectEqual(p.bodyTop(pane, r), band.viewport.y); - try std.testing.expectEqual(p.surface.body_layers[0].viewport.y, band.viewport.y); - // Sized to its message, flush with the pane's right edge, and the text - // right aligned a cell short of that edge. try std.testing.expectEqual(r.x + r.w, band.viewport.x + band.viewport.w); - try std.testing.expect(band.viewport.w < r.w - config.GUTTER); - try std.testing.expectEqualStrings("!", band.cells[layout.tagCapacity(p, band.viewport.w) - 2].grapheme()); - p.messages.live_len = 0; - p.view().prefix = .leader; - p.sync(); - _ = try p.render(p.scratch.allocator()); - try std.testing.expectEqual(full_height, p.surface.body_layers[0].viewport.h); p.view().prefix = .none; } |
