diff options
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index bca89466..e0cb69b5 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -313,6 +313,9 @@ pub const PaneFile = enum(u5) { /// A word run as a click in the pane's tag, as /tagexec is in the /// workspace's and col/<n>/exec in a column's. tagexec, + /// A line a body row: where it points and how it is coloured + /// (locations.formatRows), a results pane's; written, the pane's. + rows, pty, pty_ctl, pty_status, @@ -1163,7 +1166,7 @@ fn linesFile(target: Target) bool { .col => |c| c.file == .ctl or c.file == .exec, // `name` too: one name, however its writes cut it, applied once // its newline comes, or with its write when that is whole. - .pane => |t| t.file == .look or t.file == .exec or t.file == .ctl or t.file == .tagexec or t.file == .name, + .pane => |t| t.file == .look or t.file == .exec or t.file == .ctl or t.file == .tagexec or t.file == .name or t.file == .rows, }; } @@ -1326,6 +1329,9 @@ fn writeLines(p: *Pardes, req: Req, target: Target) Reply { o.pending.shrinkRetainingCapacity(rest); var w = req; w.data = whole; + // At the offset its first byte was written at, an earlier write's + // held line included (a rows write at 0 starts the rows over). + w.off = (req.off + (req.data.len - data.len)) -| (end + rest - data.len); // The command pane this open was answered holds no lease against its // own next command (exec.leased): that one may run there again. if (resultsFile(target)) o.results.len = 0; @@ -1611,10 +1617,10 @@ test "readdir lists the root and a pane directory without creating anything" { const dir = rdir(p, Node.of(serial, .dir), 0); const files = th.dirents(dir.bytes, &buf); - try testing.expectEqual(@as(usize, 18), files.len); + try testing.expectEqual(@as(usize, 19), files.len); for ([_][]const u8{ - "name", "body", "tag", "ctl", "addr", "dot", "limit", "data", "xdata", - "sel", "dirty", "mark", "scroll", "errors", "event", "look", "exec", "tagexec", + "name", "body", "tag", "ctl", "addr", "dot", "limit", "data", "xdata", "sel", + "dirty", "mark", "scroll", "errors", "event", "look", "exec", "tagexec", "rows", }, 0..) |name, i| try testing.expectEqualStrings(name, files[i].name); try testing.expect(th.nameAt(files, ".") == null); |
