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, 5 insertions, 5 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 2e362f77..ce92ba30 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -228,7 +228,7 @@ pub fn command(p: *Pardes, req: Req, serial: ?u32, exec: bool, in_tag: bool) Rep
}
if (p.panes[id] == null) return Reply.fail(req.tag, E.NOENT);
defer if (scratch) |s| if (v.active != s) if (p.panes[s]) |sp| if (sp.file) |f| {
- if (f.content.len == 0) p.removePane(s, null) catch {};
+ if (f.content.len == 0) p.removePane(s, null) catch |err| p.reportError(s, "exec", err);
};
p.fs.ran_at = p.panes[id].?.serial;
p.fs.no_pane_slot = false;
@@ -424,7 +424,7 @@ pub fn paneText(p: *Pardes, pane: *Pane, buf: *[pane_text_cap]u8) []const u8 {
fill: {
w.print("{d:>11} {d:>11} {d:>11} {d:>11} {d:>11} {d:>11} ", .{
pane.serial,
- pane_files.tagOf(p, pane).len,
+ if (pane_files.tagOf(p, pane)) |tag| tag.len else |_| 0, // a length, as a stat's: none when the tag cannot be made
// A terminal's body is its history, read whole on an open's first read.
if (pane.isTerminal()) panes.terminal.screenTextLen(pane) else pane_files.bodyOf(pane).len,
// A directory pane is one, as acme's isdir says.
@@ -722,7 +722,7 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM
const keyboard = p.view().active;
if (panes.Output.openDiff(p, id, f.path, f.content)) |hid| {
// ponytail: the text is gone with it; Diff on the +Diff says no such file.
- p.removePane(id, hid) catch {};
+ p.removePane(id, hid) catch |err| p.reportError(id, "pager", err);
} else |_| {}
if (p.panes[keyboard] != null) p.view().active = keyboard;
}
@@ -731,7 +731,7 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM
/// The editor's step: the text of /pager opens closed unread goes in.
pub fn fillClosedPagers(p: *Pardes) void {
for (p.fs.pages.items) |*page| {
- fillPager(p, page.serial, &page.bytes) catch {};
+ fillPager(p, page.serial, &page.bytes) catch |err| if (p.paneBySerial(page.serial)) |id| p.reportError(id, "pager", err);
page.bytes.deinit(p.gpa);
}
p.fs.pages.clearRetainingCapacity();
@@ -1359,7 +1359,7 @@ test "pane ctl read is acme's fields -- index's five, width in cells, font, tab
var want: std.ArrayList(u8) = .empty;
defer want.deinit(gpa);
try want.print(gpa, "{d:>11} {d:>11} {d:>11} {d:>11} {d:>11} {d:>11} {s} {d:>11} {d:>11} {d:>11} current mode:normal ", .{
- pane.serial, pane_files.tagOf(p, pane).len, @as(usize, 2), 0, 0, pane.cols, "default", config.tab_now, 0, 0,
+ pane.serial, (try pane_files.tagOf(p, pane)).len, @as(usize, 2), 0, 0, pane.cols, "default", config.tab_now, 0, 0,
});
try testing.expectEqualStrings(want.items, a.bytes);
try testing.expectEqual(@as(u64, a.bytes.len), call(p, .{ .tag = 1, .op = .getattr, .node = Node.of(pane.serial, .ctl) }).reply.attr.size);