From 42748f92b77367db415c8b4d0f2e537a9e1ddde7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 00:13:11 -0300 Subject: 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 --- test/panes.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/panes.zig') 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")); -- cgit v1.3