summaryrefslogtreecommitdiff
path: root/test/column_drag.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 00:42:04 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit425d9beb9c977df364ed83743cb2efdef9429478 (patch)
treeeaba2e20ff041b50539d1b47fdeb498e59237cf0 /test/column_drag.zig
parent1912878e753ce12fdc1ac72ae2e83ddfc18df002 (diff)
downloadpardes-425d9beb9c977df364ed83743cb2efdef9429478.tar.gz
pardes-425d9beb9c977df364ed83743cb2efdef9429478.zip
File the tag code into tagline.zig and draw tags beside bodies
With tags reduced to Texts, what is left of them is the computed prefix, the default and saved tails, entering and leaving a tag and the headers: that goes to tagline.zig, as acme keeps the tag half of a window in wind.c. Tag and header drawing moves next to body drawing in body_layer.zig, and the tag hit helpers go to tag_layer.zig with the Hit they read, where sameCell now also tells the lines of a taller tag apart. The docs describe the tag as a Text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/column_drag.zig')
-rw-r--r--test/column_drag.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/column_drag.zig b/test/column_drag.zig
index f128aa61..feea1bf7 100644
--- a/test/column_drag.zig
+++ b/test/column_drag.zig
@@ -37,7 +37,7 @@ fn expectOrder(p: *Pardes, before: []const Snapshot, order: []const usize) !void
try std.testing.expectEqual(saved.serial, p.col_serial[column]);
try std.testing.expectEqual(saved.count, p.col_n[column]);
try std.testing.expectEqualSlices(usize, saved.panes[0..saved.count], p.col_panes[column][0..p.col_n[column]]);
- try std.testing.expectEqualStrings(saved.tag, p.columnTag(column));
+ try std.testing.expectEqualStrings(saved.tag, pardes.tagline.columnTag(p, column));
}
}
@@ -67,7 +67,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu
_ = try p.render(frame.allocator());
var before: [4]Snapshot = undefined;
for (&before, 0..) |*saved, column| {
- saved.* = .{ .weight = p.col_weight[column], .serial = p.col_serial[column], .count = p.col_n[column], .tag = p.columnTag(column) };
+ saved.* = .{ .weight = p.col_weight[column], .serial = p.col_serial[column], .count = p.col_n[column], .tag = pardes.tagline.columnTag(p, column) };
@memcpy(saved.panes[0..saved.count], p.col_panes[column][0..saved.count]);
}
const layer = try tagLayer(p, 1);
@@ -75,8 +75,8 @@ test "column grip drag moves only its interval and keeps tag caret with the colu
p.update(.{ .mouse = headerMouse(layer, 10, .press) });
p.update(.{ .mouse = headerMouse(layer, 10, .release) });
try std.testing.expectEqual(@as(?usize, 1), p.header_column);
- const caret = p.focusedHeader().?.cur_col;
- const anchor = p.focusedHeader().?.vsel;
+ const caret = pardes.tagline.focusedHeader(p).?.cur_col;
+ const anchor = pardes.tagline.focusedHeader(p).?.vsel;
const scroll = p.header_scroll;
const target = p.col_x[3] + p.col_w[3] - 2;
const last_rect = p.rects[p.col_panes[3][0]];
@@ -93,14 +93,14 @@ test "column grip drag moves only its interval and keeps tag caret with the colu
try expectOrder(p, &before, &.{ 0, 2, 3, 1 });
try std.testing.expectEqual(active, p.active);
try std.testing.expectEqual(@as(?usize, 3), p.header_column);
- try std.testing.expectEqual(caret, p.focusedHeader().?.cur_col);
- try std.testing.expectEqual(anchor, p.focusedHeader().?.vsel);
+ try std.testing.expectEqual(caret, pardes.tagline.focusedHeader(p).?.cur_col);
+ try std.testing.expectEqual(anchor, pardes.tagline.focusedHeader(p).?.vsel);
try std.testing.expectEqual(scroll, p.header_scroll);
// The old tag envelope must not edit the new occupant of its old index,
// including the interval before hosts request another rendered frame.
p.update(.{ .mouse = stale });
try std.testing.expectEqual(@as(?usize, 3), p.header_column);
- try std.testing.expectEqual(caret, p.focusedHeader().?.cur_col);
+ try std.testing.expectEqual(caret, pardes.tagline.focusedHeader(p).?.cur_col);
_ = try p.render(frame.allocator());
try std.testing.expectEqual(before[1].serial, (try tagLayer(p, 3)).serial);
try std.testing.expectEqual(p.col_w[3] - pardes.TAG_TEXT_INSET, (try tagLayer(p, 3)).viewport.w);
@@ -110,7 +110,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu
mouse(p, .release, back);
try expectOrder(p, &before, &.{ 0, 1, 2, 3 });
try std.testing.expectEqual(@as(?usize, 1), p.header_column);
- try std.testing.expectEqual(caret, p.focusedHeader().?.cur_col);
+ try std.testing.expectEqual(caret, pardes.tagline.focusedHeader(p).?.cur_col);
try std.testing.expectEqual(active, p.active);
// A structural change between press and release must not retarget the
// in-flight drag to whichever column now occupies the original index.
@@ -165,7 +165,7 @@ test "column grip is separate from compact text and the resize seam" {
try std.testing.expect(p.drag != .column_move);
try std.testing.expect(p.header_drag);
p.update(.{ .mouse = headerMouse(layer, 0, .release) });
- try std.testing.expectEqual(@as(i32, 0), p.focusedHeader().?.cur_col);
+ try std.testing.expectEqual(@as(i32, 0), pardes.tagline.focusedHeader(p).?.cur_col);
mouse(p, .press, p.col_x[1] + config.GUTTER - 1);
try std.testing.expect(p.drag == .column_move);
mouse(p, .release, p.col_x[1] + config.GUTTER - 1);