summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 00:13:11 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit42748f92b77367db415c8b4d0f2e537a9e1ddde7 (patch)
tree3ff6606d33149581d5954dcc900eb6ab3e4f0f17 /test/panes.zig
parent23f430573efe4f6ef55b0180aa0d742ff4eca1d9 (diff)
downloadpardes-42748f92b77367db415c8b4d0f2e537a9e1ddde7.tar.gz
pardes-42748f92b77367db415c8b4d0f2e537a9e1ddde7.zip
Make the column and workspace tags Texts with the pane tag's keys
The headers had their own one-line editor with its own keys: Enter always executed, h/l and J/K moved between headers and panes, Ctrl-c/x/v cut and pasted, and TagLine refused a newline that 9P accepted. They are now Texts like a pane's tag, with no prefix and a default until edited, so normal and insert mode, undo and the look and execute keys are the body's. Moving between them is the window keys' job: Up from a pane with nothing above it reaches its column's tag and then the workspace's, Down comes back, and Left and Right walk the column tags. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/panes.zig b/test/panes.zig
index a391dba2..b9fa9a88 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -152,8 +152,8 @@ const TagLayerTests = struct {
try std.testing.expect(left.sel[0].state == .done and left.sel[0].r0 == 0);
p.update(.{ .key = .{ .cp = Key.escape } });
const long = "a" ** 60 ++ "界END";
- try std.testing.expect(p.global_tag.set(long));
- for (p.col_tags[0..p.ncol]) |*tag| try std.testing.expect(tag.set(long));
+ p.global_tag.own = try p.gpa.dupe(u8, long);
+ for (p.col_tags[0..p.ncol]) |*tag| tag.own = try p.gpa.dupe(u8, long);
_ = try p.render(frame.allocator());
for ([_]Kind{ .workspace, .column }) |kind| {
const id: usize = if (kind == .column) 1 else 0;
@@ -161,7 +161,7 @@ const TagLayerTests = struct {
const x = @as(f32, @floatFromInt(header.viewport.x)) * 10 + 62.5 * 5;
p.update(.{ .mouse = mouse(header, x, .press) });
p.update(.{ .mouse = mouse(header, x, .release) });
- try std.testing.expectEqual(@as(?u16, 63), p.topbar_col);
+ try std.testing.expectEqual(@as(i32, 63), p.focusedHeader().?.cur_col);
if (kind == .column) try std.testing.expectEqual(@as(?usize, 1), p.header_column) else try std.testing.expect(p.header_column == null);
p.update(.{ .key = .{ .cp = Key.escape } });
}
@@ -334,7 +334,7 @@ const TagNavigationTests = struct {
key(p, 'j');
try std.testing.expectEqual(@as(i32, 0), pane.tag.cur_col);
try std.testing.expectEqual(@as(usize, 0), p.active);
- try std.testing.expect(pane.focus == .tag and p.topbar_col == null);
+ try std.testing.expect(pane.focus == .tag and !p.header_focus);
window(p, 'l');
try std.testing.expectEqual(right, p.active);
try std.testing.expect(pane.focus == .body and p.panes[right].?.focus == .body);
@@ -1291,13 +1291,13 @@ test "leaving a pane or entering a header cancels an uncommitted filename" {
const pane = try p.setTestFile("untouched\n");
for ([_]bool{ false, true }) |header| {
p.active = 0;
- p.topbar_col = null;
+ p.exitHeader();
p.update(.tick);
clickPathEnd(p, pane);
p.update(.{ .paste = "/draft" });
try std.testing.expect(pane.prompt == .name);
if (header) {
- p.topbar_col = 0;
+ p.enterHeader(null);
p.update(.tick);
} else {
try std.testing.expect(p.executeBuiltinLine(0, "New"));