summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 63e7e76a..9d7557e6 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -3030,3 +3030,13 @@ test "@p<terminal>:<address> takes any address over the terminal's lines, select
try testing.expectEqual(row_before, pane.body.cur_row);
try testing.expectEqualStrings("", rd(p, root, 0, 64).bytes);
}
+
+test "a bad command inside an Edit block written whole is named, not the } after it" {
+ const p = try withFile(testing.allocator, "abc\n");
+ defer p.deinit();
+ const r = wr(p, Node.of(serialOf(p), .ctl), "Edit {\n,s/a/b/\nzq\n}\n");
+ try testing.expectEqual(Status.err, r.reply.status);
+ try testing.expect(std.mem.indexOf(u8, r.reply.ename, "\"}\"") == null);
+ try testing.expect(std.mem.indexOf(u8, r.reply.ename, "z") != null);
+ try testing.expectEqualStrings("abc\n", p.panes[0].?.file.?.content);
+}