From 4a33b8d2bd409d4a06205f28e0eb1b4cdaf49889 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:51:40 -0300 Subject: hunks: the +Diff's editor side in one place: openDiff, showDiffText and diffSource move from Output.zig, the `Diff` word's body and PaneKind.diff's test from builtins.zig, lookCommit (as lookedAtCommit) and its test from look.zig; builtins.zig's Diff is its one registration (its doc, traits and `run = hunks.word`); the three open hooks a plumber's rules would replace are a call each, look.zig's `hunks.lookedAt` (a bare look at a .diff or .patch) and `hunks.lookedAtCommit` (a commit hash) and ninep/ctl.zig's `hunks.paged` (a +Pager filled with a diff), their conditions inside them; the diff language (diff.zig, syntax.zig's highlightDiff, look's diff-line address) stays where the languages are; code locality's far share 0.575 before and after (codeloc.py --compare); goldens unchanged Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- src/locations.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/locations.zig') diff --git a/src/locations.zig b/src/locations.zig index 3dc0412d..ca6b7a7d 100644 --- a/src/locations.zig +++ b/src/locations.zig @@ -1131,7 +1131,7 @@ test "rows read back from their text are the rows: +Search's, +Callstack's and + const callstack = try formatCallstack(p, dir, "a.zig:2:8 f\n└─ a.zig:3:9 a\n"); defer p.gpa.free(callstack.content); defer freeRows(p.gpa, callstack.rows); - const hid = try pardes.panes.Output.openDiff(p, 0, patch, "--- a.zig\n+++ a.zig\n@@ -2,3 +2,4 @@\n fn f() void {\n- a(\"x\");\n+ a(\"x y\");\n+ b();\n }\n"); + const hid = try @import("hunks.zig").openDiff(p, 0, patch, "--- a.zig\n+++ a.zig\n@@ -2,3 +2,4 @@\n fn f() void {\n- a(\"x\");\n+ a(\"x y\");\n+ b();\n }\n"); const stacked = p.panes[hid].?.file.?.location_rows; // A +Diff's rows carry styles with grounds: the codec is tried on them. var grounded = false; -- cgit v1.3