summaryrefslogtreecommitdiff
path: root/src/locations.zig
diff options
context:
space:
mode:
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;