summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ninep/ctl.zig14
-rw-r--r--src/pardes.zig5
2 files changed, 18 insertions, 1 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();
diff --git a/src/pardes.zig b/src/pardes.zig
index 391fa23d..c1b12a8b 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -5719,7 +5719,10 @@ pub const Pardes = struct {
/// local socket costs microseconds and not a vsync.
pub fn serveFs(p: *Pardes, req: ctlfs.Req) ctlfs.Reply {
if (!ctlfs.changesPane(p, req)) return ctlfs.handle(p, req);
- p.needs_frame = true;
+ // An address, a limit or the mark flag is nothing drawn: a script's
+ // addr write then its close costs no frame between them.
+ const drawn = if (ctlfs.Node.target(req.node)) |t| !(t == .pane and (t.pane.file == .addr or t.pane.file == .limit or t.pane.file == .mark)) else true;
+ if (drawn) p.needs_frame = true;
p.raw_hover_intent = false;
look.cancelLookHover(p);
p.fs.serving = true;