From 82551f77833a09b313bd3e58371582abd1aedcc4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:27:42 -0300 Subject: Move looking out of pardes.zig into look.zig Pure move, no behaviour change (acme keeps this in look.c): expanding the word under a click (ExpandedWord, expandedWord, expandedSel, cursorWordSel), the n/N walk (LookFrom, lookEdge, lookStand, lookWalkPanes, lookPast, wholeRowSpan, lookSpanIn, lookWalk, landLookSpot, noteLookSource, armLookWalk), search results (Search, SearchStart, submitSearch, lookFirstHit, runSearch, searchStep, jumpResult), the look-hover preview (LookHoverWait, LookHoverPreview, FileWordSpan, PdfWordPreview, invalidateLookHover, cancelLookHover, lookHoverPane, noteLookHover, refreshLookHoverFromRaw, advanceLookHover) and lookAt with its targets (focusPaneLine, selectSpan, openPaneTarget, focusPaneByPath, clearNavigationSelection, resolveLookTarget, locationText, canonicalLookLocation, pdfLinkLocation, followPdfLink), with five tests, go verbatim to the end of look.zig after its word and target resolution. The methods become free functions taking `p: *Pardes`; their 143 call sites change from `p.lookAt(..)` to `look.lookAt(p, ..)` (tests reach them as `pardes.look.x`). Inside look.zig the moved code's `look.` prefix drops. Co-Authored-By: Claude Opus 5.5 --- test/panes.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/panes.zig') diff --git a/test/panes.zig b/test/panes.zig index e865641f..f45d42b2 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -494,7 +494,7 @@ const TreeContextTests = struct { defer frame.deinit(); _ = try p.render(frame.allocator()); try std.testing.expectEqual(@as(i32, 0), pane.scroll()); - p.lookAt(0, "/tree-context.zig:60"); + pardes.look.lookAt(p, 0, "/tree-context.zig:60"); try std.testing.expectEqual(@as(usize, 0), p.active); try std.testing.expectEqual(@as(i32, 59), pane.cur_row); const surface = try p.render(frame.allocator()); @@ -4469,7 +4469,7 @@ const LookResetTests = struct { const pane = try p.setTestFile("alpha\nbravo\ncharlie\nneedle\n"); try seed(pane, "/test.txt:3:2"); // This operand is released by Look's selection cleanup. - p.lookAt(0, pane.pointer_selections[0].?.raw_text.?); + pardes.look.lookAt(p, 0, pane.pointer_selections[0].?.raw_text.?); try cleared(pane); try std.testing.expectEqual(@as(usize, 0), p.active); try std.testing.expectEqual(@as(i32, 2), pane.cur_row); @@ -4477,7 +4477,7 @@ const LookResetTests = struct { try std.testing.expect(!pane.vsel.active); try seed(pane, "/test.txt:2:2-4"); - p.lookAt(0, pane.pointer_selections[0].?.raw_text.?); + pardes.look.lookAt(p, 0, pane.pointer_selections[0].?.raw_text.?); try cleared(pane); try std.testing.expectEqual(@as(i32, 1), pane.cur_row); try std.testing.expectEqualStrings("rav", selected(pane)); @@ -4485,7 +4485,7 @@ const LookResetTests = struct { p.gpa.free(pane.file.?.path); pane.file.?.path = try p.gpa.dupe(u8, "/tmp/look-selection-source.txt"); try seed(pane, "needle"); - p.lookAt(0, pane.pointer_selections[0].?.raw_text.?); + pardes.look.lookAt(p, 0, pane.pointer_selections[0].?.raw_text.?); try cleared(pane); try std.testing.expectEqual(@as(i32, 3), pane.cur_row); try std.testing.expectEqualStrings("needle", selected(pane)); @@ -4508,7 +4508,7 @@ const LookResetTests = struct { p.active = 0; try seed(source, if (range) "/look-destination.txt:2:2-4" else "/look-destination.txt:3:2"); try seed(destination, "previous destination"); - p.lookAt(0, source.pointer_selections[0].?.raw_text.?); + pardes.look.lookAt(p, 0, source.pointer_selections[0].?.raw_text.?); try std.testing.expectEqual(id, p.active); try cleared(source); try cleared(destination); -- cgit v1.3