diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-06 19:06:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-22 10:03:15 -0300 |
| commit | 046979b877f02a91cf52cc86b84c5619cb9363d3 (patch) | |
| tree | b0a4696329949029aef88be34e242a45b1babfc4 /src/look.zig | |
| parent | d65ec3394ff619118d9208718477469c673a5598 (diff) | |
| download | pardes-046979b877f02a91cf52cc86b84c5619cb9363d3.tar.gz pardes-046979b877f02a91cf52cc86b84c5619cb9363d3.zip | |
Def and Refs in a language-served file's tag, a diff viewer's tinted word edits, context rows that hold still under a scroll, and the pardes skill
Def and Refs (gd, gr, Ctrl-click; chorded 2-1 at the selection) for a file
a language server speaks for; hunks.zig stacks a unified diff as a diff
viewer does, its changed words on a tinted ground as delta's do; the
tree-sitter context rows stay put while the body glides under a scroll;
.agents/skills gains the pardes skill beside pardes-9p.
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/look.zig b/src/look.zig index 41cfdc0c..6ba6a8d0 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1869,6 +1869,18 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void { const before = p.active; var opened: ?usize = null; if (!focusPaneByPath(p, target.path, target.at)) { + // A .diff or .patch looked at bare: its hunks stacked in a + // +Diff (DiffLook hunks), which takes the keyboard as the + // file would; one with none in it opens as text. + if (p.settings.diff_look == .hunks and !p.look_text and target.at.line == 0 and + (std.mem.endsWith(u8, target.path, ".diff") or std.mem.endsWith(u8, target.path, ".patch"))) + if (filesystem.read(p, target.path)) |bytes| { + defer p.gpa.free(bytes); + if (panes.Output.openDiff(p, id, target.path, bytes)) |hid| { + p.active = hid; + return; + } else |_| {} + } else |_| {}; const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots); const nt = panes.File.open(p, free, target.path, target.at.line) catch |err| return lookOpenFailed(p, id, target.path, err); |
