diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 22:27:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 82551f77833a09b313bd3e58371582abd1aedcc4 (patch) | |
| tree | b2d0b53d1c2346bdbaefda8b3a5e965df377d26c /test/panes.zig | |
| parent | 5be25178e4bfc2f390164e06697155cb0237babc (diff) | |
| download | pardes-82551f77833a09b313bd3e58371582abd1aedcc4.tar.gz pardes-82551f77833a09b313bd3e58371582abd1aedcc4.zip | |
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 <[email protected]>
Diffstat (limited to 'test/panes.zig')
| -rw-r--r-- | test/panes.zig | 10 |
1 files changed, 5 insertions, 5 deletions
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); |
