diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 11:42:48 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 11:42:48 -0300 |
| commit | 71d8744b41dec56d835e30f531b96fede5d610a1 (patch) | |
| tree | 31e2a06fdcfd467d12454cde8be5a477765701b5 /core/edit_cmd.zig | |
| parent | eae5736ad923731135dd35b3783c90a3358bd0fa (diff) | |
| parent | 4569aefd55d04f434f2e2ed5e6e4a511a414cdc7 (diff) | |
| download | pardes-71d8744b41dec56d835e30f531b96fede5d610a1.tar.gz pardes-71d8744b41dec56d835e30f531b96fede5d610a1.zip | |
integration: the one client loop that the soak runs, with the tape as the handle a step is given: pardes-runners-b (10b: runtime/client.zig run by the terminal's client, the window's and the soak; a client's clipboard and links its own frontend's; an input sent before it is applied) and pardes-handle-1 (the handle's steps 0 to 2: p.tape, the directory listing and the file system read through the tape they are handed), merged without a conflict; gates in the coordinator's ledger
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/edit_cmd.zig')
| -rw-r--r-- | core/edit_cmd.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/edit_cmd.zig b/core/edit_cmd.zig index a87fdfa2..495ec786 100644 --- a/core/edit_cmd.zig +++ b/core/edit_cmd.zig @@ -77,9 +77,9 @@ const World = struct { if (std.mem.eql(u8, f.path, path)) return true; } const local = filesystem.localPath(path) orelse return true; - if (@import("exec.zig").kindOf(local) == .directory) return said(bool, why, "B: {s} is a directory", .{path}) orelse false; + if (@import("exec.zig").kindOf(w.p.tape, local) == .directory) return said(bool, why, "B: {s} is a directory", .{path}) orelse false; var buf: [4096]u8 = undefined; - if (filesystem.resolveOs(local, &buf) == null) return said(bool, why, "B: {s}: no such file", .{path}) orelse false; + if (filesystem.resolveOs(w.p.tape, local, &buf) == null) return said(bool, why, "B: {s}: no such file", .{path}) orelse false; return true; } @@ -92,7 +92,7 @@ const World = struct { fn open(ctx: *anyopaque, path: []const u8, why: *sam.Why) ?sam.File { const w: *World = @ptrCast(@alignCast(ctx)); const p = w.p; - if (filesystem.localPath(path)) |local| if (@import("exec.zig").kindOf(local) == .directory) + if (filesystem.localPath(path)) |local| if (@import("exec.zig").kindOf(p.tape, local) == .directory) return said(sam.File, why, "B: {s} is a directory", .{path}); // A look opens it, or finds it open, where a look would; the // keyboard stays where the Edit ran. @@ -112,7 +112,7 @@ const World = struct { fn read(ctx: *anyopaque, arena: std.mem.Allocator, path: []const u8, why: *sam.Why) ?[]const u8 { const w: *World = @ptrCast(@alignCast(ctx)); - if (filesystem.localPath(path)) |local| if (@import("exec.zig").kindOf(local) == .directory) + if (filesystem.localPath(path)) |local| if (@import("exec.zig").kindOf(w.p.tape, local) == .directory) return said([]const u8, why, "{s} is a directory", .{path}); const bytes = filesystem.read(w.p, path) catch |err| { // In the words Get says them (builtins.Get). @@ -177,7 +177,7 @@ pub fn run(p: *Pardes, id: usize, command: []const u8) void { var world: World = .{ .p = p, .from = id, .arena = arena }; var why: sam.Why = .{}; var text: pardes.Kind.Buf(260) = .{}; - const res = sam.run(arena, files.items, cur, command, .{ .ctx = &world, .check = World.check, .open = World.open, .read = World.read, .refuseGet = World.refuseGet, .home = p.sessionHome() }, &why) catch |err| switch (err) { + const res = sam.run(arena, files.items, cur, command, .{ .ctx = &world, .check = World.check, .open = World.open, .read = World.read, .refuseGet = World.refuseGet, .home = p.sessionHome(), .tape = p.tape }, &why) catch |err| switch (err) { error.Edit => return p.reportFailure(id, text.print("Edit: {s}", .{why.text()})), error.OutOfMemory => return p.reportError(id, "Edit", err), }; |
