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/output.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/output.zig')
| -rw-r--r-- | test/output.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/output.zig b/test/output.zig index ebea79d4..b4c018db 100644 --- a/test/output.zig +++ b/test/output.zig @@ -610,7 +610,7 @@ test "EffectCode lists readable virtual sources used by this backend" { } try std.testing.expect(count >= 3); const report = p.active; - p.lookAt(report, backend_source); + pardes.look.lookAt(p, report, backend_source); try std.testing.expect(p.active != report); const source = p.panes[p.active].?.file.?; try std.testing.expectEqualStrings(backend_source, source.path); @@ -722,7 +722,7 @@ test "n/N in ordinary text skips comment slashes and retains real paths" { defer p.deinit(); const pane = try p.setTestFile("// ordinary comment\n/// documentation comment\n(//) [///] punctuation\n/\n// /tmp\n//tmp\n"); try std.testing.expect(pane.file.?.output == null); - p.armLookWalk(0); + pardes.look.armLookWalk(p, 0); const available = p.freeSlot(); for ([_]struct { key: u21, row: i32, text: []const u8 }{ .{ .key = 'n', .row = 3, .text = "/" }, @@ -796,7 +796,7 @@ test "n/N skips formatted context and selects comment match locations" { try p.dumpState(); const restored = try Pardes.initFromDump(p.gpa, .{ .tty_only = true }, p.dump_out.?); defer restored.deinit(); - restored.armLookWalk(id); + pardes.look.armLookWalk(restored, id); const restored_result = restored.panes[id].?; restored.update(.{ .key = .{ .cp = 'n' } }); try std.testing.expectEqual(@as(i32, @intCast(matches[0])), restored_result.cur_row); @@ -1562,7 +1562,7 @@ test "stacked search and LSP results retain source tint navigation and dump owne try std.testing.expectEqual(@intFromEnum(pardes.syntax.Syn.number), file.highlights[number]); p.active = id; pane.mode = .normal; - p.armLookWalk(id); + pardes.look.armLookWalk(p, id); for ([_]struct { key: u21, match: usize }{ .{ .key = 'n', .match = 0 }, .{ .key = 'n', .match = 1 }, .{ .key = 'N', .match = 0 } }) |step| { p.update(.{ .key = .{ .cp = step.key } }); try std.testing.expectEqual(@as(i32, @intCast(matches[step.match])), pane.cur_row); @@ -1585,7 +1585,7 @@ test "stacked search and LSP results retain source tint navigation and dump owne try std.testing.expectEqualSlices(u8, before.colors, after.colors); } restored.active = id; - restored.armLookWalk(id); + pardes.look.armLookWalk(restored, id); restored.update(.{ .key = .{ .cp = 'N' } }); try std.testing.expectEqual(@as(i32, @intCast(matches[1])), restored.panes[id].?.cur_row); try std.testing.expectEqualStrings(source_text, source.file.?.content); |
