diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exec.zig b/src/exec.zig index c636cc7c..93f524cf 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -529,8 +529,8 @@ fn routeToRepl(p: *Pardes, from: usize, text: []const u8) Routed { p.view().active = from; var rec: [96]u8 = undefined; var rw = std.Io.Writer.fixed(&rec); - rw.print("{d} repl", .{src.serial}) catch {}; - for (bound[0..n]) |i| rw.print(" {c}", .{p.panes[i].?.repl.?.letter}) catch {}; + rw.print("{d} repl", .{src.serial}) catch unreachable; // a u32 and bound's 26 letters fit 96 + for (bound[0..n]) |i| rw.print(" {c}", .{p.panes[i].?.repl.?.letter}) catch unreachable; pardes.ctlfs.events.notePath(p, "ask", rw.buffered()); return .asked; } @@ -1251,8 +1251,9 @@ pub fn runWord(p: *Pardes, id: usize, w: *const pardes.Kind.Word, line: []const var next: pardes.Kind.Buf(256) = .{}; var out: std.Io.Writer = .fixed(&next.bytes); var lines = std.mem.tokenizeScalar(u8, s.values.slice(), '\n'); - while (lines.next()) |l| if (!std.mem.eql(u8, l[0 .. std.mem.indexOfScalar(u8, l, ' ') orelse l.len], name)) out.print("{s}\n", .{l}) catch return; - out.print("{s} {s}\n", .{ name, arg }) catch return; + const full = std.fmt.bufPrint(&said, "{s}: the pane's values are past {d} bytes: not kept", .{ name, next.bytes.len }) catch name; + while (lines.next()) |l| if (!std.mem.eql(u8, l[0 .. std.mem.indexOfScalar(u8, l, ' ') orelse l.len], name)) out.print("{s}\n", .{l}) catch return p.reportFailure(id, full); + out.print("{s} {s}\n", .{ name, arg }) catch return p.reportFailure(id, full); next.len = @intCast(out.buffered().len); s.values = next; } |
