summaryrefslogtreecommitdiff
path: root/src/locations.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/locations.zig')
-rw-r--r--src/locations.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/locations.zig b/src/locations.zig
index e8c31bf0..f6a0cf9c 100644
--- a/src/locations.zig
+++ b/src/locations.zig
@@ -51,7 +51,7 @@ pub fn freeRows(gpa: std.mem.Allocator, rows: []Row) void {
/// A copy of `rows` and all they own, gpa's: rows are a blob (File.State
/// `location_rows`), made again rather than written.
-pub fn cloneRows(gpa: std.mem.Allocator, rows: []const Row) ![]Row {
+pub fn cloneRows(gpa: std.mem.Allocator, rows: []const Row) error{OutOfMemory}![]Row {
const out = try gpa.alloc(Row, rows.len);
var made: usize = 0;
errdefer {
@@ -84,7 +84,7 @@ pub fn freeRowList(gpa: std.mem.Allocator, rows: *std.ArrayList(Row)) void {
/// `row` onto a list being built, with copies of its own of the path and
/// the colours it borrows.
-pub fn appendRow(gpa: std.mem.Allocator, rows: *std.ArrayList(Row), row: Row) !void {
+pub fn appendRow(gpa: std.mem.Allocator, rows: *std.ArrayList(Row), row: Row) error{OutOfMemory}!void {
var owned = row;
owned.path = try gpa.dupe(u8, row.path);
errdefer gpa.free(owned.path);
@@ -227,8 +227,8 @@ const Source = struct { path: []const u8, bytes: []const u8 };
/// 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;
+ if (std.ascii.eqlIgnoreCase(std.Io.Dir.path.extension(path), ".pdf")) return null;
+ const lexical = std.Io.Dir.path.resolvePosix(arena, &.{ dir, path }) catch return null;
var pathbuf: [4096]u8 = undefined;
const full = if (filesystem.resolve(p, path, dir, &pathbuf)) |resolved| resolved.path else lexical;
for (p.panes) |slot| if (slot) |pane| {