diff options
| -rw-r--r-- | docs/fs.md | 3 | ||||
| -rw-r--r-- | src/look.zig | 2 | ||||
| -rw-r--r-- | src/ninep/ctl.zig | 3 | ||||
| -rw-r--r-- | src/ninep/events.zig | 8 |
4 files changed, 14 insertions, 2 deletions
@@ -764,7 +764,8 @@ slot, EBUSY for a held lock) -- and logs its reason exactly once, as `err <seria <file>: <why>`, with no `msg` for it. A builtin a click runs (Save, get's `Modified`, Tty with no room, Edit) is no exception. What is not a failure: a look that finds nothing answers nothing and logs one `err` -(`look: no match for ...`), the write succeeding; and a command line run in +(`look: no match for ...`, the same miss again counted, `(x2)`, as any +repeated `err` is), the write succeeding; and a command line run in a command pane ends in its own time, told by its `exit` record. `tag` reads the whole tag as the pane shows it: the computed path or PDF diff --git a/src/look.zig b/src/look.zig index 236f0687..5d16e6eb 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1242,7 +1242,7 @@ fn missed(p: *Pardes, id: usize, comptime fmt: []const u8, args: anytype) void { p.fs.unlogged = false; const serial = if (p.panes[id]) |pane| pane.serial else 0; var rec: [said.len + 32]u8 = undefined; - pardes.ctlfs.events.notePath(p, "err", std.fmt.bufPrint(&rec, "{d} look: {s}", .{ serial, why }) catch return); + pardes.ctlfs.events.noteErrCounted(p, std.fmt.bufPrint(&rec, "{d} look: {s}", .{ serial, why }) catch return); } /// After a look at `path:N` focused its pane: a line past the end focuses diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 2c6d2010..7321f569 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2710,6 +2710,9 @@ test "a builtin that fails through exec, tagexec or a column's exec fails the wr _ = wr(p, @intFromEnum(tree.TopFile.look), "zzqqnotthere\n"); try testing.expect(th.logHas(p, "look: no match for \"zzqqnotthere\"")); try testing.expect(!th.logHas(p, "msg 1 Look: no match")); + // The same miss again is that record counted, as any repeated err is. + _ = wr(p, @intFromEnum(tree.TopFile.look), "zzqqnotthere\n"); + try testing.expect(th.logHas(p, "look: no match for \"zzqqnotthere\" (x2)\n")); } test "a word written to a raw terminal's look is listed as in normal mode" { diff --git a/src/ninep/events.zig b/src/ninep/events.zig index add0d750..570cae78 100644 --- a/src/ninep/events.zig +++ b/src/ninep/events.zig @@ -181,6 +181,14 @@ pub fn noteMessage(p: *Pardes, serial: u32, said: []const u8) void { /// answers nothing: a per-pane readable error file would be a second. /// `dump <path>` when a Dump is written, `restore <path>` first in a /// Restore's replacement. +/// `notePath` for an `err` record: the same one again straight after is +/// counted, `(x2)`, as every err is. +pub fn noteErrCounted(p: *Pardes, text: []const u8) void { + bootFirst(p); + var buf: [pardes.memory.limits.host_path_cap + 16]u8 = undefined; + pushCounting(p, std.fmt.bufPrint(&buf, "err {s}\n", .{text}) catch return); +} + pub fn notePath(p: *Pardes, what: []const u8, path: []const u8) void { bootFirst(p); var buf: [pardes.memory.limits.host_path_cap + 16]u8 = undefined; |
