summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:11:42 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit073695995ecf4a269da8d338b23bfab1d3369c05 (patch)
tree0d8e573e509d2462de31cb1f7198dc5e44aabaf2 /src/ninep/ctl.zig
parentcf49c329cb401a5c530ef2533066702fe1545360 (diff)
downloadpardes-073695995ecf4a269da8d338b23bfab1d3369c05.tar.gz
pardes-073695995ecf4a269da8d338b23bfab1d3369c05.zip
+Errors with no room anywhere logs its text rather than fail the Edit
Edit's p and = put their output in +Errors, and when its column had no room the placement refusal failed the whole Edit. +Errors now tries every column with room, the last first, and with none its text is logged as msg records, a line each; the Edit succeeds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 25abd9b5..378dd844 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1447,3 +1447,16 @@ test "an exec line over the command limit fails the write and says the limit; a
try testing.expect(th.logHas(p, "a command line is at most 1024 bytes"));
try testing.expectEqual(Status.ok, wr(p, root_exec, "Msg " ++ "z" ** 1100 ++ "\n").reply.status);
}
+
+test "Edit's p and = never fail for want of room for +Errors: the text is logged instead" {
+ const p = try withFile(testing.allocator, "one\ntwo\n");
+ defer p.deinit();
+ p.update(.{ .resize = .{ .cols = 80, .rows = 6 } });
+ const ctl_node = Node.of(serialOf(p), .ctl);
+ try testing.expectEqual(Status.ok, wr(p, ctl_node, "Edit ,p\n").reply.status);
+ try testing.expect(th.logHas(p, " one\n") and th.logHas(p, " two\n"));
+ p.sync();
+ var count: usize = 0;
+ for (p.panes) |slot| count += @intFromBool(slot != null);
+ try testing.expectEqual(@as(usize, 1), count); // the +Errors that had no room is gone
+}