From 20d79644b6283a425ad0daed869afed8e706b8c2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 21:36:56 -0300 Subject: kinds #44, what kinds 5 could not restore: as text the place names a line of the page (L:F, F its share of the page's lines), the wheel, gj, gk, Ctrl-e and Ctrl-y move a line and a page at the window's edge (j, k and the window keys still turn a page, as the keys test pins); with pictures a wheel's whole notch glides there, half the way each frame drawn and the rest by its fourth tick, a touchpad's fraction moving at once; pdf.script shows the lines, and the touchpad pane case waits out a notch's glide Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/panes.zig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/panes.zig b/test/panes.zig index 2da7a313..55ad303d 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -4166,7 +4166,7 @@ const PdfAddon = struct { try std.testing.expect(p.surface.pointer_shape != .link); } - test "a touchpad's fraction of a turn moves a PDF's strip by that fraction of a notch's" { + test "a wheel's notch glides a PDF's strip there over four ticks, and a touchpad's fraction of a turn moves it that fraction of a notch's at once" { if (!addons.has_pdf) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .cols = 80, .rows = 24, .tty_only = true }); @@ -4178,13 +4178,22 @@ const PdfAddon = struct { const r = p.view().rects[id]; const slot = p.panes[id].?.addon.?; var at: [3]f32 = undefined; + var first: f32 = 0; for (&at, [_]f32{ 0, 1, 0.25 }) |*a, turn| { if (turn > 0) p.update(.{ .mouse = .{ .button = .wheel_down, .kind = .press, .col = r.x + 4, .row = r.y + r.h - 2, .amount = turn } }); _ = try p.render(arena.allocator()); + if (turn == 1) first = slot.thumb_at; + // (a frame and a tick each, four) + for (0..4) |_| { + now += 16 * std.time.ns_per_ms; + p.advance(now); + p.update(.tick); + _ = try p.render(arena.allocator()); + } a.* = slot.thumb_at; } const notch = at[1] - at[0]; - try std.testing.expect(notch > 0); + try std.testing.expect(notch > 0 and first > at[0] and first < at[1]); try std.testing.expectApproxEqRel(notch / 4, at[2] - at[1], 0.05); } }; -- cgit v1.3