summaryrefslogtreecommitdiff
path: root/src/body_layer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/body_layer.zig')
-rw-r--r--src/body_layer.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/body_layer.zig b/src/body_layer.zig
index 2fc1454c..b8336b7b 100644
--- a/src/body_layer.zig
+++ b/src/body_layer.zig
@@ -188,9 +188,8 @@ pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
var temporary: Surface = .{ .cols = r.w, .rows = @intCast(logical_rows + pane.tag_rows), .cells = temporary_cells };
const synthetic: Rect = .{ .x = 0, .y = 0, .w = r.w, .h = @intCast(logical_rows + pane.tag_rows) };
try renderBody(p, &temporary, arena, pane, synthetic, id, active, null);
- const first_row: usize = if (p.settings.tag_bottom) 0 else pane.tag_rows;
for (0..logical_rows) |row| {
- const start = (row + first_row) * r.w + config.GUTTER;
+ const start = (row + pane.tag_rows) * r.w + config.GUTTER;
@memcpy(layer.cells[row * width ..][0..width], temporary_cells[start..][0..width]);
}
layer.kind = .body;
@@ -204,8 +203,8 @@ pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
layer.setContextLines(pane.wrap_line[0..pane.context_rows]);
layer.cursor = null;
if (temporary.cursor) |cursor| {
- if (cursor.x >= config.GUTTER and cursor.y >= first_row)
- layer.cursor = .{ .x = cursor.x - config.GUTTER, .y = @intCast(cursor.y - first_row), .bar = cursor.bar };
+ if (cursor.x >= config.GUTTER and cursor.y >= pane.tag_rows)
+ layer.cursor = .{ .x = cursor.x - config.GUTTER, .y = @intCast(cursor.y - pane.tag_rows), .bar = cursor.bar };
}
// The grid: the layer's first rows, as many as the body has, each a
// body row high; its caret where one of them has it. (pane.rows is the