From 4c4fce7373ea72b10e8d9bb7aa3c91c3d5bbf0f5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 22:05:53 -0300 Subject: helix: the page-scroll mismatches were the view's height, not a rule: pardes's scroll (Text.scrollViewMove, halfPageMove, gotoWindow) is helix's commands.rs scroll/page_* rule for rule, but hxdiff ran pardes at 80x24, where its chrome leaves the pane 21 rows to helix's 22 (half page 10 to 11, page 21 to 22); the harness runs the core at 80x25 so the pane is helix's 22 and refuses a case whose pane is not, and helix-keys.md says why: hxdiff's twelve page-scroll cases and gb-after-zz pass (16 to 3), hxparity's five page waivers match again (5 to 0) Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/hxdiff.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/hxdiff.zig b/test/hxdiff.zig index 85c854a0..7c72475f 100644 --- a/test/hxdiff.zig +++ b/test/hxdiff.zig @@ -376,12 +376,19 @@ test "differential reports compare values and report every changed field" { try std.testing.checkAllAllocationFailures(allocator, Check.run, .{ want, changed }); } +/// The text rows of hx-harness's one view (80x24 less its two lines). +const helix_view_rows = 22; + fn runCase(arena: std.mem.Allocator, case: Case, pane_kind: []const u8) !Result { // fresh core per case: the tty_only boot — one shell pane, tty mode, no // greeting. Live-session contract: sizes arrive as the first resize event. const core = try pardes.Pardes.init(gpa, .{ .tty_only = true }); defer core.deinit(); - core.update(.{ .resize = .{ .cols = 80, .rows = 24 } }); + // helix's harness runs at 80x24, a view of 22 text rows under its + // status and command lines; pardes's chrome takes a row more, so 25 + // rows give its pane the same 22 that every page, half page and gb + // counts in + core.update(.{ .resize = .{ .cols = 80, .rows = 25 } }); pump(core); if (std.mem.eql(u8, pane_kind, "file")) { @@ -418,6 +425,9 @@ fn runCase(arena: std.mem.Allocator, case: Case, pane_kind: []const u8) !Result } } else fatal("case {s}: unknown pane {s}", .{ case.name, pane_kind }); + const shown = core.panes[core.view().active] orelse return error.NoActivePane; + if (shown.rows != helix_view_rows) fatal("case {s}: the pane shows {d} rows, not helix's {d}: resize the core to match", .{ case.name, shown.rows, helix_view_rows }); + // keys: helix notation — printables verbatim, <...> specials var ki: usize = 0; while (ki < case.keys.len) { -- cgit v1.3