summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 17:01:01 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitc89ab8eb499e04205f7570e6de71071523e4fa73 (patch)
tree5e342799e793f3754ed77613e238f99ded08e6e7 /src/ninep/ctl.zig
parent9e78acbfeee714ae5a4ce152c2be8c6a7abccf3e (diff)
downloadpardes-c89ab8eb499e04205f7570e6de71071523e4fa73.tar.gz
pardes-c89ab8eb499e04205f7570e6de71071523e4fa73.zip
A write to addr, limit or mark asks for no frame, so its close is not held behind one
Every write that changes a pane set needs_frame, an addr write too, so the editor drew a whole frame after each and the clunk that followed waited for the turn while it did: 0.5 ms (Debug) to 1.2 ms a clunk, what made addr and event write-back 4-10x acme's. An address, a limit and the mark flag are nothing drawn; their writes no longer ask for a frame. Clunk after an addr write: 0.518 -> 0.015 ms (Debug tty, fs.py client). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index e7274c5e..b9268208 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2428,6 +2428,20 @@ test "ctl reads acme's fields in acme's order, undo and redo flags included, the
try testing.expectEqualStrings("1", f[9]);
}
+test "a write to addr, limit or mark asks for no frame; one to body does" {
+ const p = try withFile(testing.allocator, "one\n");
+ defer p.deinit();
+ const serial = serialOf(p);
+ for ([_]tree.PaneFile{ .addr, .limit, .mark }) |file| {
+ p.needs_frame = false;
+ _ = p.serveFs(.{ .tag = 1, .op = .write, .node = Node.of(serial, file), .data = if (file == .mark) "1" else "#0" });
+ try testing.expect(!p.needs_frame);
+ }
+ p.needs_frame = false;
+ _ = p.serveFs(.{ .tag = 1, .op = .write, .node = Node.of(serial, .body), .data = "two\n" });
+ try testing.expect(p.needs_frame);
+}
+
test "every EINVAL a write gets says why, in its err record too; DEL is a control character in a line" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();