diff options
Diffstat (limited to 'src/Messages.zig')
| -rw-r--r-- | src/Messages.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Messages.zig b/src/Messages.zig index 053950da..c7ff09be 100644 --- a/src/Messages.zig +++ b/src/Messages.zig @@ -397,7 +397,7 @@ pub fn reportError(p: *Pardes, id: usize, operation: []const u8, err: anyerror) /// them instead of letting the last one win the row. pub fn collectNotices(p: *Pardes, pane: *Pane, r: Rect, id: usize) void { pane.notices.len = 0; - if (r.w <= config.GUTTER or r.h <= BOX_H) return; + if (r.w <= config.GUTTER or r.h <= pane.tag_rows) return; // Oldest message line on top, so lines already up do not move when a // new one lands under them; when rows run out the oldest go first. for (pane.msg_older[0..pane.msg_older_len], 0..) |line, i| pane.notices.pushAt(.older, @intCast(i), line.slot); @@ -409,7 +409,7 @@ pub fn collectNotices(p: *Pardes, pane: *Pane, r: Rect, id: usize) void { // carrying the cursor: a prompt you cannot see is a prompt you type // into blind. A two-row pane spends its only body row on one notice, // which is what the single shared row used to do anyway. - const room: u8 = @intCast(@min(@as(u16, Pane.Notices.max), r.h - BOX_H)); + const room: u8 = @intCast(@min(@as(u16, Pane.Notices.max), r.h - pane.tag_rows)); const n = &pane.notices; if (n.span() <= room) return; // Too short for the gaps: close them up in screen order, and if even @@ -743,7 +743,7 @@ test "notices stack over the body's top rows without moving them" { defer frame.deinit(); const r = p.rects[id]; - const top = p.bodyTop(r); + const top = p.bodyTop(pane, r); // A message and a leader prefix at once: two chips, in the order // collectNotices chose, each one row tall and each one row further down. @@ -754,7 +754,7 @@ test "notices stack over the body's top rows without moving them" { _ = try p.render(frame.allocator()); try std.testing.expectEqual(@as(u8, 2), pane.notices.len); // An overlay, not a reservation: the body still starts where it did. - try std.testing.expectEqual(top, p.bodyTop(r)); + try std.testing.expectEqual(top, p.bodyTop(pane, r)); var seen: usize = 0; for (p.surface.tagLayers()) |*layer| { |
