diff options
Diffstat (limited to 'core/Kind.zig')
| -rw-r--r-- | core/Kind.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/Kind.zig b/core/Kind.zig index 13ef8edd..7641c2d1 100644 --- a/core/Kind.zig +++ b/core/Kind.zig @@ -278,7 +278,7 @@ pub fn open(p: *Pardes, id: usize, k: u8, path: ?[]const u8, bytes: ?[]const u8) _ = reopen(p, id, s, bytes); // Its file watched, as a text's is: changed on disk, it opens again // from it (fileChanged); retirePane lets the watch go. - if (s.path.len > 0 and @import("fs.zig").localPath(s.path) != null) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = true } }); + if (s.path.len > 0 and @import("fs.zig").localPath(s.path) != null) p.emit(.{ .watch = .{ .pane = .at(id), .on = true } }); return pane; } @@ -995,7 +995,7 @@ const Call = struct { for (o.jobs) |token| if (token != 0) { cl.slot.tokens = token; }; - if (cl.p) |p| if (p.panes[cl.id]) |pane| for (o.jobs) |token| if (token != 0) p.emit(.{ .job = .{ .pane = @intCast(cl.id), .serial = pane.serial, .token = token } }); + if (cl.p) |p| if (p.panes[cl.id]) |pane| for (o.jobs) |token| if (token != 0) p.emit(.{ .job = .{ .pane = .at(cl.id), .serial = pane.serial, .token = token } }); for (o.cancels) |token| if (token != 0) { for (&cl.slot.jobs) |*j| if (j.*) |job| if (job.token == token) { cl.slot.gpa.free(job.in); @@ -1013,7 +1013,7 @@ const Call = struct { return o; }; const p = cl.p orelse return o; - if (o.said.len > 0) if (o.err) p.reportFailure(cl.id, o.said) else p.setMessage(cl.id, o.said); + if (o.said.len > 0) if (o.err) p.reportFailure(cl.id, o.said) else p.setMessage(.at(cl.id), o.said); if (o.pane_name.len > 0) textPane(p, cl.id, cl.slot, o.pane_name, o.pane_text); if (o.look.len > 0) @import("look.zig").lookAt(p, cl.id, o.look); if (o.exec.len > 0) @import("mouse.zig").dispatchPointerBuiltin(p, cl.id, pardes.config.exec_cmd, o.exec, null); @@ -1052,8 +1052,8 @@ fn moreFound(p: *Pardes, id: usize, rows: []const u8) void { const rp = p.panes[pane.search_pane orelse return] orelse return; const rf = if (rp.file) |*f| f else return; const o = if (rf.output) |*x| x else return; - const content = std.mem.concat(p.gpa, u8, &.{ rf.content, rows }) catch |err| return p.reportError(id, "found", err); - pardes.panes.Output.fillResults(p, id, std.Io.Dir.path.dirname(rf.path) orelse p.sessionDir(), .search, o.arg(), content, null) catch |err| p.reportError(id, "found", err); + const content = std.mem.concat(p.gpa, u8, &.{ rf.content, rows }) catch |err| return p.reportError(.at(id), "found", err); + pardes.panes.Output.fillResults(p, id, std.Io.Dir.path.dirname(rf.path) orelse p.sessionDir(), .search, o.arg(), content, null) catch |err| p.reportError(.at(id), "found", err); } fn same(o: Outcome) Outcome { @@ -1299,8 +1299,8 @@ pub var seed_base: u64 = 0; /// kind's pane, a Look of one going to its kind (look.zig lookKind). fn textPane(p: *Pardes, id: usize, slot: *const Slot, name: []const u8, text: []const u8) void { const dir = std.Io.Dir.path.dirname(slot.path) orelse p.sessionDir(); - const content = p.gpa.dupe(u8, text) catch |err| return p.reportError(id, name, err); - pardes.panes.Output.fillResults(p, id, dir, .kind, name, content, null) catch |err| p.reportError(id, name, err); + const content = p.gpa.dupe(u8, text) catch |err| return p.reportError(.at(id), name, err); + pardes.panes.Output.fillResults(p, id, dir, .kind, name, content, null) catch |err| p.reportError(.at(id), name, err); } /// A kind for tests of the core's side of a kind's pane, no library: a |
