diff options
Diffstat (limited to 'core/panes.zig')
| -rw-r--r-- | core/panes.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/panes.zig b/core/panes.zig index 7ea479b9..b928917a 100644 --- a/core/panes.zig +++ b/core/panes.zig @@ -1192,8 +1192,8 @@ pub fn retirePane(p: *Pardes, pane: *Pane) void { if (pane.file) |*file| panes.File.leaveTwins(p, file); const watched = (if (pane.file) |f| f.output == null else false) or (if (pane.addon) |k| k.path.len > 0 else false); for (p.panes, 0..) |slot, id| if (slot == pane) { - if (watched) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = false } }); - if (pane.isTerminal()) p.emit(.{ .close_pty = .{ .pane = @intCast(id) } }); + if (watched) p.emit(.{ .watch = .{ .pane = .at(id), .on = false } }); + if (pane.isTerminal()) p.emit(.{ .close_pty = .{ .pane = .at(id) } }); // Its pty's end and its emulator are the authority's: a replica's // speculation that closes a terminal waits for it. if (pane.terminal != null) tape.poison("close a terminal"); @@ -1294,7 +1294,7 @@ pub fn emitSpawn(p: *Pardes, id: usize, serial: u32, cwd: []const u8) void { if (p.spawn_dirs[id]) |old| p.gpa.free(old); p.spawn_dirs[id] = null; if (cwd.len > effect_path_cap) p.spawn_dirs[id] = p.gpa.dupe(u8, cwd) catch null; - p.emit(.{ .spawn = .{ .pane = @intCast(id), .serial = serial, .cwd = .from(if (cwd.len > effect_path_cap) "" else cwd) } }); + p.emit(.{ .spawn = .{ .pane = .at(id), .serial = serial, .cwd = .from(if (cwd.len > effect_path_cap) "" else cwd) } }); } /// A command pane: a terminal whose child is `$SHELL -c line` rather @@ -1713,7 +1713,7 @@ test "owned cwd EOF failure retains the pane and Del retries its close" { p.sync(); while (p.nextEffect()) |_| {} allocator.fail_index = allocator.alloc_index; - p.update(.{ .eof = .{ .pane = 0 } }); + p.update(.{ .eof = .{ .pane = .at(0) } }); try std.testing.expectEqual(parent, p.panes[0].?); try std.testing.expectEqual(parent, child.cwd.inherited); try std.testing.expectEqual(Text.Mode.normal, parent.body.mode); |
