diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/exec.zig b/src/exec.zig index 5a421f19..215a4fd1 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -959,6 +959,12 @@ pub fn runBuiltinFrom(p: *Pardes, b: Builtin, id: usize, txt: []const u8, arg: ? p.fs.unlogged = false; pane.msg_announcement = true; } + // A word for one kind of pane, on another: refused with why, not a + // silent nothing (Palette on a file, Filter on a PDF). + if (builtins.registry.needs(b)) |kind| if (p.panes[id] == null or !kind.has(pane)) { + var said: [96]u8 = undefined; + return p.reportFailure(id, std.fmt.bufPrint(&said, "{s}: only {s} pane takes it", .{ @tagName(b), kind.noun() }) catch "only another kind of pane takes it"); + }; const c: builtins.Ctx = .{ .p = p, .pane = pane, .id = id, .txt = txt, .arg = arg, .from_body = from_body }; builtins.registry.dispatch(b, c); } |
