diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ninep/ctl.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 4abb6fcd..f4a3d730 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -864,6 +864,8 @@ fn getRefused(p: *Pardes, pane: *Pane) ?[]const u8 { const id = p.paneBySerial(pane.serial).?; // Kept in +Unsaved, as Exit's refusal is; the notice is short. The // write's err record logs it, not a msg too. + // And logged `unsaved <serial> <name>`, as the other refusals are. + tree.events.noteLog(p, .unsaved, pane); const listed = std.fmt.allocPrint(p.gpa, "{s}: Modified\n\nget again to discard\n", .{f.path}) catch null; if (listed) |content| panes.Output.openUnsaved(p, id, content); p.fs.unlogged = true; @@ -1465,6 +1467,8 @@ test "get reloads the pane from disk and reports a missing file without losing d const asked = wr(p, ctl_node, "get\n"); try testing.expectEqual(E.IO, asked.errno()); try testing.expect(std.mem.endsWith(u8, asked.reply.ename, ": Modified (get again to discard)")); + var unsaved: [4200]u8 = undefined; + try testing.expect(th.logHas(p, try std.fmt.bufPrint(&unsaved, "unsaved {d} {s}/missing.txt\n", .{ serial, directory }))); try testing.expectEqual(E.NOENT, wr(p, ctl_node, "get\n").errno()); try testing.expect(p.paneBySerial(serial) != null); try testing.expectEqualStrings("from disk\nunsaved\n", pane.file.?.content); |
