diff options
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 4cb4728f..2d733af6 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -210,7 +210,7 @@ pub fn command(p: *Pardes, req: Req, serial: ?u32, exec: bool, in_tag: bool) Rep // scratch made as New makes one (and its column), dropped // unannounced when the look went elsewhere. var scratch: ?usize = null; - if (p.panes[id] == null and serial == null and p.anyPane() == null) { + if (p.panes[id] == null and serial == null and panes.anyPane(p) == null) { if (exec) { p.exec_header = true; defer p.exec_header = false; @@ -218,7 +218,7 @@ pub fn command(p: *Pardes, req: Req, serial: ?u32, exec: bool, in_tag: bool) Rep continue; } const free = p.freeSlot() orelse return Reply.fail(req.tag, E.NOSPC); - p.newScratchFor(id, .scratch); + panes.newScratchFor(p, id, .scratch); if (p.panes[free] == null) return Reply.fail(req.tag, E.NOSPC); p.active = free; id = free; @@ -779,7 +779,7 @@ pub fn writeRoot(p: *Pardes, req: Req) Reply { continue; } // An empty window (no pane at all) still takes its session words. - if (p.panes[p.active] == null and p.anyPane() != null) return Reply.fail(req.tag, E.NOENT); + if (p.panes[p.active] == null and panes.anyPane(p) != null) return Reply.fail(req.tag, E.NOENT); p.fs.session_write = true; defer p.fs.session_write = false; if (runBuiltin(p, req, p.active, line)) |refusal| return refusal; @@ -2257,7 +2257,7 @@ test "with no pane at all, the root look opens its file and the root exec runs i p.session_dir_len = @intCast(session.len); const Empty = struct { fn all(q: *Pardes) !void { - while (q.anyPane()) |k| _ = wr(q, Node.of(q.panes[k].?.serial, .ctl), "delete\n"); + while (panes.anyPane(q)) |k| _ = wr(q, Node.of(q.panes[k].?.serial, .ctl), "delete\n"); } }; try Empty.all(p); @@ -2277,7 +2277,7 @@ test "with no pane at all, the root look opens its file and the root exec runs i try Empty.all(p); try testing.expectEqual(Status.ok, wr(p, @backingInt(tree.TopFile.exec), "echo hi\n").reply.status); - const made = p.panes[p.anyPane().?].?; + const made = p.panes[panes.anyPane(p).?].?; try testing.expect(made.command != null); try testing.expectEqualStrings(session, made.cwdSlice()); } |
