summaryrefslogtreecommitdiff
path: root/src/locations.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-06 19:06:32 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit046979b877f02a91cf52cc86b84c5619cb9363d3 (patch)
treeb0a4696329949029aef88be34e242a45b1babfc4 /src/locations.zig
parentd65ec3394ff619118d9208718477469c673a5598 (diff)
downloadpardes-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/locations.zig')
-rw-r--r--src/locations.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/locations.zig b/src/locations.zig
index 6a604907..7755f6fd 100644
--- a/src/locations.zig
+++ b/src/locations.zig
@@ -159,7 +159,9 @@ const Pending = struct {
const Source = struct { path: []const u8, bytes: []const u8 };
-fn sourceText(p: *pardes.Pardes, arena: std.mem.Allocator, dir: []const u8, path: []const u8) ?Source {
+/// A file's text as a look from `dir` finds it: an open pane's, unsaved
+/// edits and all, else the disk's. Null for a PDF or one not there.
+pub fn sourceText(p: *pardes.Pardes, arena: std.mem.Allocator, dir: []const u8, path: []const u8) ?Source {
if (std.ascii.eqlIgnoreCase(std.fs.path.extension(path), ".pdf")) return null;
const lexical = std.fs.path.resolvePosix(arena, &.{ dir, path }) catch return null;
var pathbuf: [4096]u8 = undefined;