summaryrefslogtreecommitdiff
path: root/core/ninep
diff options
context:
space:
mode:
Diffstat (limited to 'core/ninep')
-rw-r--r--core/ninep/ctl.zig8
-rw-r--r--core/ninep/events.zig14
2 files changed, 12 insertions, 10 deletions
diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig
index 84f3ba6b..e47aec94 100644
--- a/core/ninep/ctl.zig
+++ b/core/ninep/ctl.zig
@@ -2055,7 +2055,7 @@ test "a language server question that finds nothing, cannot be answered, or is a
_ = wr(p, root_exec, "Recent\n");
const listed = p.paneBySerial(try std.fmt.parseInt(u32, std.mem.trimEnd(u8, rd(p, root_exec, 0, 64).bytes, "\n"), 10)).?;
p.lspRequest(listed, .incoming_calls, "");
- try testing.expect(std.mem.indexOf(u8, p.panes[listed].?.msg[0..p.panes[listed].?.msg_len], "Callers: only a file's pane asks") != null);
+ try testing.expect(std.mem.indexOf(u8, p.messages.saidBy(p.panes[listed].?), "Callers: only a file's pane asks") != null);
// Nothing found: Callers says so, and the waiting write hears it.
p.fs.late_failure_len = 0;
p.lspRequest(id, .incoming_calls, "");
@@ -2264,7 +2264,7 @@ test "a column takes panes until their documented minimums fill it, not until no
const new = @backingInt(tree.TopFile.new);
while (call(p, .{ .tag = 1, .op = .open, .node = new }).reply.status == .ok) p.sync();
p.sync();
- const avail = p.view().screen_h - (p.topBarHeight() + layout.columnBarHeight(p));
+ const avail = p.view().screen_h - (p.topBarHeight() + layout.columnBarHeight(p) + layout.noticeRowHeight(p));
for (0..p.view().ncol) |c| {
var need: u32 = 0;
for (p.view().cols[c].panes[0..p.view().cols[c].n]) |k| need += layout.minRows(p, k);
@@ -2388,7 +2388,9 @@ test "a file changed on disk under unsaved edits is not reloaded: it says so, ge
pardes.panes.File.changed(p, 0, "three\n");
try testing.expectEqualStrings("two\nmine\n", f.content);
try testing.expect(f.revision != f.saved_revision);
- try testing.expect(th.logHas(p, "changed on disk (get reloads it, Save overwrites it)"));
+ // ...and asks, in its tag (Messages.waiting), which /log hears.
+ try testing.expect(p.messages.waiting(p.panes[0].?) != null);
+ try testing.expect(th.logHas(p, "changed on disk\n"));
var want: [32]u8 = undefined;
try testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "changed {d}\n", .{serial})));
// Exit and get still ask about the edits.
diff --git a/core/ninep/events.zig b/core/ninep/events.zig
index e18b5d96..fe9ec79a 100644
--- a/core/ninep/events.zig
+++ b/core/ninep/events.zig
@@ -1089,20 +1089,20 @@ test "writing an event record back performs the action it names" {
const w = wr(p, event, "FX0 10\n");
try testing.expectEqual(Status.ok, w.reply.status);
- try testing.expectEqualStrings("fs-ran", pane.msg[0..pane.msg_len]);
+ try testing.expectEqualStrings("fs-ran", p.messages.saidBy(pane));
- pane.msg_len = 0;
+ p.messages.live_len = 0;
try testing.expectEqual(Status.ok, wr(p, event, "FX0 10\nFX0 10\n").reply.status);
- try testing.expectEqualStrings("fs-ran", pane.msg[0..pane.msg_len]);
+ try testing.expectEqualStrings("fs-ran", p.messages.saidBy(pane));
// The last record needs no newline, as any line file's last line.
- pane.msg_len = 0;
+ p.messages.live_len = 0;
const bare = wr(p, event, "FX0 10");
try testing.expectEqual(Status.ok, bare.reply.status);
try testing.expectEqual(@as(u32, 6), bare.reply.written);
- try testing.expectEqualStrings("fs-ran", pane.msg[0..pane.msg_len]);
+ try testing.expectEqualStrings("fs-ran", p.messages.saidBy(pane));
- pane.msg_len = 0;
+ p.messages.live_len = 0;
for ([_][]const u8{
"FX0 10\nFQ0 1\n", // unknown type character
"FX0 999\n", // out of range
@@ -1111,7 +1111,7 @@ test "writing an event record back performs the action it names" {
"F\n",
}) |bad| {
try testing.expectEqual(E.INVAL, wr(p, event, bad).errno());
- try testing.expectEqual(@as(usize, 0), pane.msg_len);
+ try testing.expectEqual(@as(usize, 0), p.messages.saidBy(pane).len);
}
// A look written back sets what look reads back.
_ = wr(p, event, "FL0 3\n");