From 383256a741117596931c4e3817491041fde5229d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:27:59 -0300 Subject: config: look_preview_delay_frames is a u16, as its ?u16 was never null: every orelse return after it, look.zig's discarded delay, and the report's never-written Look hover delay: off line go, the tests passing the constant (pardes.zig, ninep/tree.zig and ctl.zig's test take one line each) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/panes.zig | 2 +- test/pdf.zig | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/panes.zig b/test/panes.zig index 6b2af760..f083a88e 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -769,7 +769,7 @@ const ClickCursorTests = struct { try std.testing.expect(std.mem.endsWith(u8, unselected, " gamma\n")); } - const delay = config.look_preview_delay_frames orelse return; + const delay = config.look_preview_delay_frames; p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = x + 2, .row = y + 2 } }); for (0..delay) |_| p.update(.tick); const selected_preview = p.look_hover_preview orelse return error.MissingSelectionHover; diff --git a/test/pdf.zig b/test/pdf.zig index 16522af6..ef05f789 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -148,7 +148,7 @@ const PdfLinkTests = struct { fn hover(p: *Pardes, cell: Cell) void { p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = cell.col, .row = cell.row } }); - for (0..(config.look_preview_delay_frames orelse 0)) |_| p.update(.tick); + for (0..config.look_preview_delay_frames) |_| p.update(.tick); } test "PDF links hover clears on leave page and reload while right drag chooses Look text" { @@ -1764,7 +1764,8 @@ test "PDF native mouse selection, Look, and highlights share page geometry" { // presentation state. In particular it must not borrow the click path, // whose page activation and persistent selection are intentional effects // of a gesture rather than observation. - if (config.look_preview_delay_frames) |delay| { + { + const delay = config.look_preview_delay_frames; const active_before = p.active; const page_before = pv.page; const scroll_before = pv.document_scroll_y; -- cgit v1.3