diff options
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/draw.zig b/src/draw.zig index e141ce31..4f9c6c87 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -96,12 +96,10 @@ pub fn place(p: *Pardes, s: *Surface) void { if (r.h <= pane.tag_rows) continue; const tx = r.x + config.GUTTER; const tw = r.w - config.GUTTER; - var leader_buf: [16]u8 = undefined; for (0..pane.notices.len) |i| { - const text = Messages.noticeText(p, pane, i, &leader_buf); - const chip = Messages.noticeCols(p, text, tw); - if (chip == 0) continue; - pane.notices.left[i] = tx + tw - chip; + const left = pane.notices.left[i]; + if (left == std.math.maxInt(u16)) continue; + const chip = tx + tw - left; s.addRegion(.{ .kind = .notice, .owner = owner, .serial = pane.serial, .active = active, .notice = @intCast(i), .rect = .{ .x = tx + tw - chip, .y = body_y + @as(u16, pane.notices.row[i]), .w = chip, .h = BOX_H } }); } } @@ -521,6 +519,8 @@ fn resolved(color: Color, default: ?[3]u8, palette: ?[16][3]u8) ?[3]u8 { } pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { + const taped = pardes.tape.enter(p, .render); + defer pardes.tape.leave(p, taped); panes.File.refreshHighlights(p); const s = &p.surface; const ncells = @as(usize, p.screen_w) * p.screen_h; @@ -606,9 +606,6 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { for (&p.panes, 0..) |*slot, id| { const pane = slot.* orelse continue; - pane.body_rows = 0; - pane.body_visible_rows = 0; - pane.context_row_limit = null; s.body_layers[id].rows = 0; try renderPane(p, s, arena, pane, p.rects[id], id, id == p.active); } @@ -976,7 +973,6 @@ pub fn paintHeaders(p: *Pardes, s: *Surface, arena: std.mem.Allocator) !void { const chrome = p.chromeTheme(); // global tagbar: full width, top rows — unless a native shell has // taken its commands over, in which case the rows are not ours to draw - tagline.revealHeader(p); if (s.region(.workspace_tag, Region.none)) |region| { const top = if (p.header_focus and p.header_column == null) p.header_top else 0; const layer = &s.tag_layers[MAX_PANES + MAX_COLS]; @@ -2286,12 +2282,9 @@ test "a body with context rows is painted once, and the grid's rows are what a p const cells = try arena.allocator().alloc(Cell, s.cells.len); @memset(cells, .{}); var plain: Surface = .{ .cols = s.cols, .rows = s.rows, .cells = cells }; - const saved = .{ pane.body_rows, pane.body_visible_rows, pane.context_row_limit }; - pane.body_rows = 0; - pane.body_visible_rows = 0; - pane.context_row_limit = null; + pane.view.layered = false; try body_layer.renderBody(p, &plain, arena.allocator(), pane, p.rects[0], 0, true, null, null); - pane.body_rows, pane.body_visible_rows, pane.context_row_limit = saved; + pane.view.layered = true; for (0..body.rect.h) |row| { const y = body.rect.y + row; for (0..body.rect.w) |col| { |
