diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 20:47:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 22:07:55 -0300 |
| commit | 80d47cd246f37356fd2e705495936f6546613e29 (patch) | |
| tree | c9b8025faa82717c9cc51d98dd4ce774dc0fad13 /test | |
| parent | 4c3dbce20f11204f6d4bfb715239beae74259e7f (diff) | |
| download | pardes-80d47cd246f37356fd2e705495936f6546613e29.tar.gz pardes-80d47cd246f37356fd2e705495936f6546613e29.zip | |
fields #39, a header's focus is one optional union: header_focus and header_column, of which (false, some column) never happened, are the session's header: ?Header, workspace or column, and p.headerColumn() the column whose tag has the keyboard (null for none or the workspace's); tagline.enterHeader and exitHeader set it in one write each, layout.reorderColumn moves the focused column's index in place, and the reads in 17 files say p.header != null where they said header_focus; views.zig's per-view fields name header; a dump written before this change loads it as the default once: an Upgrade or Restore from it comes back with the keyboard on a pane, not a header, and the wire's semantics change; gates on tui: core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok; gui unit-test 1518/1519 (1 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test')
| -rw-r--r-- | test/column_drag.zig | 10 | ||||
| -rw-r--r-- | test/panes.zig | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/column_drag.zig b/test/column_drag.zig index 94d61827..7f5b6e94 100644 --- a/test/column_drag.zig +++ b/test/column_drag.zig @@ -72,7 +72,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu const stale = headerMouse(layer, 4, .press); p.update(.{ .mouse = headerMouse(layer, 10, .press) }); p.update(.{ .mouse = headerMouse(layer, 10, .release) }); - try std.testing.expectEqual(@as(?usize, 1), p.header_column); + try std.testing.expectEqual(@as(?usize, 1), p.headerColumn()); const caret = pardes.tagline.focusedHeader(p).?.cur_col; const anchor = pardes.tagline.focusedHeader(p).?.vsel; const scroll = p.header_scroll; @@ -90,14 +90,14 @@ test "column grip drag moves only its interval and keeps tag caret with the colu mouse(p, .release, target); 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(@as(?usize, 3), p.headerColumn()); 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(@as(?usize, 3), p.headerColumn()); 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); @@ -107,7 +107,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu mouse(p, .drag, back); 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(@as(?usize, 1), p.headerColumn()); 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 @@ -116,7 +116,7 @@ test "column grip drag moves only its interval and keeps tag caret with the colu layout.reorderColumn(p, 1, 2); mouse(p, .release, p.col_x[0] + config.GUTTER); try expectOrder(p, &before, &.{ 1, 0, 2, 3 }); - try std.testing.expectEqual(@as(?usize, 0), p.header_column); + try std.testing.expectEqual(@as(?usize, 0), p.headerColumn()); try std.testing.expect(p.drag == .none); } diff --git a/test/panes.zig b/test/panes.zig index 4188eecd..c1c2ef9b 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -125,7 +125,7 @@ const TagLayerTests = struct { p.update(.{ .mouse = mouse(header, x, .press) }); p.update(.{ .mouse = mouse(header, x, .release) }); try std.testing.expectEqual(@as(i32, 63), pardes.tagline.focusedHeader(p).?.cur_col); - if (kind == .column) try std.testing.expectEqual(@as(?usize, 1), p.header_column) else try std.testing.expect(p.header_column == null); + if (kind == .column) try std.testing.expectEqual(@as(?usize, 1), p.headerColumn()) else try std.testing.expect(p.headerColumn() == null); p.update(.{ .key = .{ .cp = Key.escape } }); } } |
