summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 16:41:27 -0300
committerGabriel Schneider <[email protected]>2026-11-19 18:42:47 -0300
commit78d94c4a62ec3f4039a475b637ff6a60649fde52 (patch)
tree92b7d29d43bd1f563291db3aa1ab4b90ba55824a /core/builtins.zig
parentd0e36bb453526af64349a4eb2335b86c94bea56d (diff)
downloadpardes-78d94c4a62ec3f4039a475b637ff6a60649fde52.tar.gz
pardes-78d94c4a62ec3f4039a475b637ff6a60649fde52.zip
core: the entries that take or answer a slot take and answer its type (P21, pardes-ids change 2): a pane's slot is `Pane.Id` in the twelve entries that took it, six as `usize` (setCwd, acknowledgeShell, setMessage, setStatus, reportError, noteLateFailure) and six as `u8` (readerFailed, shellFailed, restartFailed, saveFailed, reloadWatchedFile, File.deleted), and in what adoptShell answers (`?Pane.Id`); a view's slot is `View.Id` in closeView, leaveView, awayView, rejoinView and the hand-written toView (its `to_view` variant is `Pardes.View.Id` now, and its replay arm unchanged) and in what openView answers (`?View.Id`); the tape's other variants follow their inners' types with no edit (`Args`); each inner converts where its body indexes (`id.index()`), passes the id itself to another entry, and the core's own code stays integers; every caller converts at its own line, `p.reportError(.at(id), ..)` (the decl literal of the parameter's type), 514 calls in 56 files written by a script that refuses any path outside the workspace (`.scratch/sketch/reorg/pardes-ids/wrap.py`), 46 `.index()`; nothing the compiler caught was a pane's slot passed as a view's or the reverse: what it caught were a script's wrong guesses (Editor.reportError(err) and macos.zig's own reloadWatchedFile, same names, undone) and the integers a view's id met (views.zig's tests, replica.zig's Authority and Peers.join, host_io's Adoption); in files another agent is in, each conversion on the line that was there: core/Kind.zig 5 lines, core/Addon.zig 4, core/replica.zig 23 (Authority.openView and join, closeView/toView/awayView/rejoinView/leaveView calls, Peers.join's `openView`, tests), test/replicas.zig 1; the tape's records are smaller (a `usize` is a byte in six inputs) and its shape moves, so the semantics word moves, 313a99190b93a8c5 -> c47ecf638b3f4b9f; test/perf.zig untouched (its harness id does not move); the Mac: runtime/macos.zig 16 call lines, abi/pardes.h unchanged; 581 lines changed in 56 files, no line added. Gate (load 4 to 28: a drat build and other agents' gates beside): tui core-test 841/984 (143 skipped), shell-test 1020/1023, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds of 70 steps, 0 failures, process-test lspcomplete and lspcompletemoved (the base's), gui unit-test 1618/1622 (BaselineHarnessMismatch, the base's); replicas --clients 5 (TMPDIR /tmp/claude-1000/ids, alternated with the base twice, both pass both times): diverged 0, unequal 0 at rtt 30, 80, 207, deltas checked/wrong 1811/0, 1838/0, 1715/0, quiet checks 567/0, 650/0, 544/0, stops not on may_wait 0 (its corpus-through-a-client scene fails at step 21 as on the base with that TMPDIR); two earlier runs of this tree under a load of 10 to 28 ended in a leak of Places' compiled regex (Places.derive from Query.produce) and one rtt-207 run in an assertion in mouse.kindMouse's clamp during a client's speculation, the leak not seen in the eight runs of this tree after them (the full soak, each rtt alone, single seeds), the assertion not in the two full runs after it, and neither in three full runs of the base (by reading neither touches a slot: in the report); daemon.py plain, --far, --games, --window-clients, --upgrade both ways against pardes-tree's base prefix pass; test/cross_replay.py (tui records, gui replays): 27 digests agree in each of three replicas; rollback-bench runs; the macOS library for Linux and aarch64-macos and the FreeBSD cross-build build; frames (gpu/ids-2 against tree1) 77/77 byte-identical in Debug, unit-test 1618/1622 there too, perfab corpus2x -0.059% (session noise 0.134%, threshold 0.4%), pictures identical in all 10 runs, perfops 97 counts within 0.1% (largest image-frame on longline +0.0274%), key-down on medium 10,040,104 -> 10,039,959 an operation (-0.0014%), render on medium 11,455,764 -> 11,455,707 (-0.0005%)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig106
1 files changed, 53 insertions, 53 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index 7add3d9c..ca13bd59 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -458,7 +458,7 @@ pub const Kill = struct {
if (names.len > 0 and running)
c.p.reportFailure(c.id, "Kill: no running command has that first word")
else
- c.p.setMessage(c.id, "Kill: nothing running");
+ c.p.setMessage(.at(c.id), "Kill: nothing running");
}
};
@@ -477,7 +477,7 @@ pub const Dump = struct {
to = path;
}
// Never a Dump said done that wrote nothing: its failure is said.
- dump.dumpTo(c.p, to) catch |err| c.p.reportError(c.id, "Dump", err);
+ dump.dumpTo(c.p, to) catch |err| c.p.reportError(.at(c.id), "Dump", err);
}
};
@@ -578,7 +578,7 @@ pub const Mount = struct {
c.p.fs.mount(c.p.gpa, name, dial) catch |err| {
var said: pardes.Kind.Buf(200) = .{};
if (err == error.BadDial) return c.p.reportFailure(c.id, said.print("Mount: bad dial address: {s} (unix!/path, /path, tcp!<numeric-ip>!<port>, or a session name)", .{dial[0..@min(dial.len, 100)]}));
- return c.p.reportError(c.id, "Mount", err);
+ return c.p.reportError(.at(c.id), "Mount", err);
};
// A socket path that is not there: said so (ENOENT), not a dial
// that went unanswered.
@@ -600,7 +600,7 @@ pub const Mount = struct {
c.p.gpa.free(gone.dial);
}
var what: pardes.Kind.Buf(160) = .{};
- return c.p.reportError(c.id, what.print("Mount {s} {s}", .{ name[0..@min(name.len, 32)], dial }), err);
+ return c.p.reportError(.at(c.id), what.print("Mount {s} {s}", .{ name[0..@min(name.len, 32)], dial }), err);
};
}
};
@@ -612,15 +612,15 @@ pub const Unmount = struct {
pub const requires_arg = true;
pub fn run(c: Ctx) void {
var args = std.mem.tokenizeAny(u8, c.arg orelse "", " \t");
- const name = args.next() orelse return c.p.reportError(c.id, "Unmount name", error.MissingArgument);
- if (args.next() != null) return c.p.reportError(c.id, "Unmount name", error.TooManyArguments);
+ const name = args.next() orelse return c.p.reportError(.at(c.id), "Unmount name", error.MissingArgument);
+ if (args.next() != null) return c.p.reportError(.at(c.id), "Unmount name", error.TooManyArguments);
pardes.filesystem.unmount(c.p, name) catch |err| {
// "no such": the words 9ns reads as ENOENT.
if (err == error.NotMounted) {
var said: pardes.Kind.Buf(96) = .{};
return c.p.reportFailure(c.id, said.print("Unmount: no such mount {s}", .{name}));
}
- return c.p.reportError(c.id, "Unmount", err);
+ return c.p.reportError(.at(c.id), "Unmount", err);
};
}
};
@@ -634,9 +634,9 @@ pub const Msg = struct {
pub const quiet = true; // it IS the message row
pub fn run(c: Ctx) void {
if (c.arg) |text|
- c.p.setMessage(c.id, text)
+ c.p.setMessage(.at(c.id), text)
else
- c.p.reportError(c.id, comptime word(@This()), error.NoMessage);
+ c.p.reportError(.at(c.id), comptime word(@This()), error.NoMessage);
}
};
@@ -653,7 +653,7 @@ pub const Themes = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.themes_buffer, .steps = true, .commands = true };
pub fn run(c: Ctx) void {
- panes.Output.openThemes(c.p, c.id) catch |err| c.p.reportError(c.id, "themes", err);
+ panes.Output.openThemes(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "themes", err);
}
};
@@ -679,7 +679,7 @@ pub const DumpThemes = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
if (c.p.configDir() == null) {
- c.p.reportError(c.id, "dump themes", error.NoConfigDirectory);
+ c.p.reportError(.at(c.id), "dump themes", error.NoConfigDirectory);
return;
}
c.p.emit(.{ .dump_themes = .{ .pane = @intCast(c.id) } });
@@ -694,7 +694,7 @@ pub const Fonts = struct {
pub const gui_only = true;
pub const in_window = true;
pub fn run(c: Ctx) void {
- panes.Output.openFonts(c.p, c.id) catch |err| c.p.reportError(c.id, "fonts", err);
+ panes.Output.openFonts(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "fonts", err);
}
};
@@ -709,7 +709,7 @@ pub const TreeContext = struct {
const file = &c.pane.file.?;
const arg = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
const on = if (arg.len == 0) !file.tree_context else if (std.mem.eql(u8, arg, "on")) true else if (std.mem.eql(u8, arg, "off")) false else {
- c.p.reportError(c.id, "TreeContext", error.ExpectedOnOrOff);
+ c.p.reportError(.at(c.id), "TreeContext", error.ExpectedOnOrOff);
return;
};
file.tree_context = on;
@@ -845,7 +845,7 @@ pub const Get = struct {
}
if (!panes.Output.fileTraits(f.output).saves) return c.p.reportFailure(c.id, "Get: only a file pane takes it");
var home_buf: [4096]u8 = undefined;
- const path = if (typed.len == 0) c.pane.file.?.path else std.Io.Dir.path.resolvePosix(c.p.scratch.allocator(), &.{ Pardes.paneDir(c.pane), c.p.expandHome(typed, &home_buf) }) catch |err| return c.p.reportError(c.id, "Get", err);
+ const path = if (typed.len == 0) c.pane.file.?.path else std.Io.Dir.path.resolvePosix(c.p.scratch.allocator(), &.{ Pardes.paneDir(c.pane), c.p.expandHome(typed, &home_buf) }) catch |err| return c.p.reportError(.at(c.id), "Get", err);
// A file that is not there, or a directory, is said before unsaved
// edits are asked about: there would be nothing to load over them.
if (typed.len > 0) if (@import("fs.zig").localPath(path)) |local| {
@@ -896,7 +896,7 @@ pub const Incl = struct {
if (std.mem.eql(u8, typed, "-")) {
for (p.incl.items) |dir| p.gpa.free(dir);
p.incl.clearRetainingCapacity();
- return p.setMessage(c.id, "Incl: none");
+ return p.setMessage(.at(c.id), "Incl: none");
}
// All checked before any is taken: `-` clears, alone; a directory
// is absolute (or ~) and there.
@@ -918,24 +918,24 @@ pub const Incl = struct {
var words = std.mem.tokenizeAny(u8, typed, " \t");
while (words.next()) |dir_word| {
var home_buf: [4096]u8 = undefined;
- const full = std.Io.Dir.path.resolvePosix(p.scratch.allocator(), &.{ Pardes.paneDir(c.pane), p.expandHome(dir_word, &home_buf) }) catch |err| return p.reportError(c.id, "Incl", err);
+ const full = std.Io.Dir.path.resolvePosix(p.scratch.allocator(), &.{ Pardes.paneDir(c.pane), p.expandHome(dir_word, &home_buf) }) catch |err| return p.reportError(.at(c.id), "Incl", err);
if (!std.Io.Dir.path.isAbsolute(full)) return p.reportFailure(c.id, "Incl: invalid directory");
for (p.incl.items) |dir| {
if (std.mem.eql(u8, dir, full)) break;
} else {
- const copy = p.gpa.dupe(u8, full) catch |err| return p.reportError(c.id, "Incl", err);
+ const copy = p.gpa.dupe(u8, full) catch |err| return p.reportError(.at(c.id), "Incl", err);
p.incl.append(p.gpa, copy) catch |err| {
p.gpa.free(copy);
- return p.reportError(c.id, "Incl", err);
+ return p.reportError(.at(c.id), "Incl", err);
};
}
}
if (typed.len > 0) return;
var list: std.Io.Writer.Allocating = .init(p.scratch.allocator());
- list.writer.writeAll("Incl:") catch |err| return p.reportError(c.id, "Incl", err);
- for (p.incl.items) |dir| list.writer.print(" {s}", .{dir}) catch |err| return p.reportError(c.id, "Incl", err);
- if (p.incl.items.len == 0) list.writer.writeAll(" none") catch |err| return p.reportError(c.id, "Incl", err);
- p.setMessage(c.id, list.written());
+ list.writer.writeAll("Incl:") catch |err| return p.reportError(.at(c.id), "Incl", err);
+ for (p.incl.items) |dir| list.writer.print(" {s}", .{dir}) catch |err| return p.reportError(.at(c.id), "Incl", err);
+ if (p.incl.items.len == 0) list.writer.writeAll(" none") catch |err| return p.reportError(.at(c.id), "Incl", err);
+ p.setMessage(.at(c.id), list.written());
}
};
@@ -961,8 +961,8 @@ pub const Zerox = struct {
if (@import("edit_cmd.zig").busyOn(c.p, c.id)) return c.p.reportFailure(c.id, "Zerox: " ++ @import("edit_cmd.zig").e_busy);
const f = c.pane.file orelse return c.p.reportFailure(c.id, "Zerox: only a file pane takes it");
if (f.output != null or f.listing != null or f.mini != null) return c.p.reportFailure(c.id, "Zerox: only a file pane takes it");
- const free = c.p.freeSlot() orelse return c.p.reportError(c.id, "Zerox", error.NoPaneSlots);
- _ = panes.File.zerox(c.p, c.id, free) catch |err| return c.p.reportError(c.id, "Zerox", err);
+ const free = c.p.freeSlot() orelse return c.p.reportError(.at(c.id), "Zerox", error.NoPaneSlots);
+ _ = panes.File.zerox(c.p, c.id, free) catch |err| return c.p.reportError(.at(c.id), "Zerox", err);
layout.placeNew(c.p, c.id, c.id, free, .doc);
}
};
@@ -1022,7 +1022,7 @@ pub const Del = struct {
// about once, and the same Del again, nothing edited since, closes.
if (warnModifiedIn(c, .Del, .{ .pane = c.id })) return;
// An attachment's rows go back to its owner: nothing to ask.
- if (layout.ownerOf(c.p, c.id)) |owner| return c.p.removePane(c.id, owner) catch |err| c.p.reportError(c.id, "close", err);
+ if (layout.ownerOf(c.p, c.id)) |owner| return c.p.removePane(c.id, owner) catch |err| c.p.reportError(.at(c.id), "close", err);
const at = layout.findPane(c.p, c.id);
const above = if (at) |f| layout.expandedNeighbor(c.p, f.col, f.idx, .above) else null;
// An owner's attachments close with it: below is past them.
@@ -1052,7 +1052,7 @@ pub const Del = struct {
if (c.pane.msg_announcement) c.pane.msg_len = 0;
return;
}
- c.p.removePane(c.id, to) catch |err| return c.p.reportError(c.id, "close", err);
+ c.p.removePane(c.id, to) catch |err| return c.p.reportError(.at(c.id), "close", err);
}
};
@@ -1110,8 +1110,8 @@ pub const Edit = struct {
pub const Undo = struct {
pub fn run(c: Ctx) void {
if (@import("edit_cmd.zig").busyOn(c.p, c.id)) return c.p.reportFailure(c.id, "Undo: " ++ @import("edit_cmd.zig").e_busy);
- if (c.pane.file) |f| if (f.history.journal.done == 0) return c.p.setMessage(c.id, "Undo: nothing to undo");
- edit.undoStep(c.p.editor(), &c.pane.body, true) catch |err| c.p.reportError(c.id, "Undo", err);
+ if (c.pane.file) |f| if (f.history.journal.done == 0) return c.p.setMessage(.at(c.id), "Undo: nothing to undo");
+ edit.undoStep(c.p.editor(), &c.pane.body, true) catch |err| c.p.reportError(.at(c.id), "Undo", err);
}
};
@@ -1119,8 +1119,8 @@ pub const Undo = struct {
pub const Redo = struct {
pub fn run(c: Ctx) void {
if (@import("edit_cmd.zig").busyOn(c.p, c.id)) return c.p.reportFailure(c.id, "Redo: " ++ @import("edit_cmd.zig").e_busy);
- if (c.pane.file) |f| if (f.history.journal.done == f.history.journal.steps.items.len) return c.p.setMessage(c.id, "Redo: nothing to redo");
- edit.undoStep(c.p.editor(), &c.pane.body, false) catch |err| c.p.reportError(c.id, "Redo", err);
+ if (c.pane.file) |f| if (f.history.journal.done == f.history.journal.steps.items.len) return c.p.setMessage(.at(c.id), "Redo: nothing to redo");
+ edit.undoStep(c.p.editor(), &c.pane.body, false) catch |err| c.p.reportError(.at(c.id), "Redo", err);
}
};
@@ -1150,7 +1150,7 @@ pub const Delcol = struct {
// acme's Delcol refuses a column with unsaved text (exec.c delcol,
// cols.c colclean), once: the next Delcol closes it.
if (warnModifiedIn(c, .Delcol, .{ .column = col })) return;
- layout.removeColumn(c.p, col) catch |err| c.p.reportError(c.id, "close column", err);
+ layout.removeColumn(c.p, col) catch |err| c.p.reportError(.at(c.id), "close column", err);
}
};
@@ -1216,12 +1216,12 @@ pub const Repl = struct {
var buf: pardes.Kind.Buf(320) = .{};
var idbuf: [48]u8 = undefined;
if (arg.len == 0) {
- if (pane.repl == null) return c.p.setMessage(c.id, "Repl: not bound");
- return c.p.setMessage(c.id, buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
+ if (pane.repl == null) return c.p.setMessage(.at(c.id), "Repl: not bound");
+ return c.p.setMessage(.at(c.id), buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
}
if (std.mem.eql(u8, arg, "-")) {
pane.repl = null;
- return c.p.setMessage(c.id, "Repl: unbound");
+ return c.p.setMessage(.at(c.id), "Repl: unbound");
}
const manifest = @import("grammar_manifest.zig");
const grammars = manifest.all;
@@ -1252,7 +1252,7 @@ pub const Repl = struct {
return c.p.reportFailure(c.id, w.buffered());
};
if (pane.repl) |r| if (r.lang == lang)
- return c.p.setMessage(c.id, buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
+ return c.p.setMessage(.at(c.id), buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
// The lowest letter no other REPL of the language has: freed ones
// come back.
var letter: u8 = 'a';
@@ -1266,7 +1266,7 @@ pub const Repl = struct {
if (letter > 'z') return c.p.reportFailure(c.id, "Repl: every letter of the language is taken");
pane.repl = .{ .lang = lang, .letter = letter };
pane.repl_warned = false;
- c.p.setMessage(c.id, buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
+ c.p.setMessage(.at(c.id), buf.print("Repl: {s}", .{exec.replId(&idbuf, pane)}));
}
};
@@ -1289,8 +1289,8 @@ pub const Joincol = struct {
pub const Tutor = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
- const free = c.p.freeSlot() orelse return c.p.reportError(c.id, "Tutor", error.NoPaneSlots);
- _ = panes.openTutorView(c.p, free) catch |err| return c.p.reportError(c.id, "Tutor", err);
+ const free = c.p.freeSlot() orelse return c.p.reportError(.at(c.id), "Tutor", error.NoPaneSlots);
+ _ = panes.openTutorView(c.p, free) catch |err| return c.p.reportError(.at(c.id), "Tutor", err);
layout.placeNew(c.p, c.id, c.id, free, .doc); // a doc like any other
}
};
@@ -1300,7 +1300,7 @@ pub const Help = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.help_buffer };
pub fn run(c: Ctx) void {
- panes.Output.openHelp(c.p, c.id, "") catch |err| c.p.reportError(c.id, "help", err);
+ panes.Output.openHelp(c.p, c.id, "") catch |err| c.p.reportError(.at(c.id), "help", err);
}
};
@@ -1331,10 +1331,10 @@ fn openConfigFile(c: Ctx, name: []const u8, path: []const u8, initial: []const u
}
if (real != null) return look.lookAt(c.p, c.id, path);
// Not there yet: a pane named for it, which Save makes.
- const free = c.p.freeSlot() orelse return c.p.reportError(c.id, name, error.NoPaneSlots);
+ const free = c.p.freeSlot() orelse return c.p.reportError(.at(c.id), name, error.NoPaneSlots);
panes.newScratchFor(c.p, c.id, .scratch);
const made = c.p.panes[free] orelse return;
- @import("ninep/pane.zig").nameBuffer(c.p, free, path, false) catch |err| return c.p.reportError(c.id, name, err);
+ @import("ninep/pane.zig").nameBuffer(c.p, free, path, false) catch |err| return c.p.reportError(.at(c.id), name, err);
if (initial.len > 0) if (made.file) |*f| {
_ = panes.File.replace(c.p, f, 0, f.content.len, initial);
};
@@ -1347,7 +1347,7 @@ pub const DumpConfig = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.dump_config_buffer };
pub fn run(c: Ctx) void {
- panes.Output.openConfig(c.p, c.id) catch |err| c.p.reportError(c.id, "config", err);
+ panes.Output.openConfig(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "config", err);
}
};
@@ -1360,14 +1360,14 @@ pub const LocationsConfig = struct {
pub fn run(c: Ctx) void {
const argument = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
const next = c.p.locations_config.parse(argument) catch |err| {
- c.p.reportError(c.id, "LocationsConfig", err);
+ c.p.reportError(.at(c.id), "LocationsConfig", err);
return;
};
c.p.locations_config = next;
// Bare, it is a question, and the window is the answer. With arguments
// it is a setting, and a setting that opens a window is noise.
if (argument.len != 0) return;
- report(c) catch |err| c.p.reportError(c.id, "LocationsConfig", err);
+ report(c) catch |err| c.p.reportError(.at(c.id), "LocationsConfig", err);
}
fn report(c: Ctx) !void {
@@ -1387,7 +1387,7 @@ pub const Messages = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.messages_buffer };
pub fn run(c: Ctx) void {
- panes.Output.openMessages(c.p, c.id) catch |err| c.p.reportError(c.id, "messages", err);
+ panes.Output.openMessages(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "messages", err);
}
};
@@ -1399,7 +1399,7 @@ pub const Build = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.build_buffer };
pub fn run(c: Ctx) void {
- panes.Output.openBuild(c.p, c.id) catch |err| c.p.reportError(c.id, "build", err);
+ panes.Output.openBuild(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "build", err);
}
};
@@ -1409,7 +1409,7 @@ pub const Changelog = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.changelog_buffer };
pub fn run(c: Ctx) void {
- panes.Output.openChangelog(c.p, c.id) catch |err| c.p.reportError(c.id, "changelog", err);
+ panes.Output.openChangelog(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "changelog", err);
}
};
@@ -1421,7 +1421,7 @@ pub const Mini = struct {
pub fn run(c: Ctx) void {
panes.mini.open(c.p, c.id, c.arg orelse "") catch |err|
- c.p.reportError(c.id, "Mini", err);
+ c.p.reportError(.at(c.id), "Mini", err);
}
};
@@ -1577,8 +1577,8 @@ pub const Follow = struct {
};
if (!f.follow and last != c.id) return c.p.reportFailure(c.id, "Follow: this text has a chain: Follow on one of its panes");
const col = (layout.findPane(c.p, last) orelse return c.p.reportFailure(c.id, "Follow: the pane is not laid out")).col;
- const free = c.p.freeSlot() orelse return c.p.reportError(c.id, "Follow", error.NoPaneSlots);
- const made = panes.File.zerox(c.p, c.id, free) catch |err| return c.p.reportError(c.id, "Follow", err);
+ const free = c.p.freeSlot() orelse return c.p.reportError(.at(c.id), "Follow", error.NoPaneSlots);
+ const made = panes.File.zerox(c.p, c.id, free) catch |err| return c.p.reportError(.at(c.id), "Follow", err);
const keep = v.active;
if (col + 1 < v.ncol) {
c.p.exec_column = col + 1;
@@ -1596,7 +1596,7 @@ pub const Follow = struct {
made.file.?.follow = true;
c.pane.follow_scroll = f.scroll;
made.follow_scroll = made.file.?.scroll;
- made.appendTag(" Unfollow") catch |err| c.p.reportError(c.id, "Follow", err);
+ made.appendTag(" Unfollow") catch |err| c.p.reportError(.at(c.id), "Follow", err);
}
};
@@ -1694,7 +1694,7 @@ pub const History = struct {
panes.Output.openHistory(c.p, c.id) catch |err| switch (err) {
error.NoStateFile => c.p.reportFailure(c.id, "History: no state file to list (DumpDir)"),
error.NoDumps => c.p.reportFailure(c.id, "History: no dumps yet"),
- else => c.p.reportError(c.id, "History", err),
+ else => c.p.reportError(.at(c.id), "History", err),
};
}
};
@@ -1704,7 +1704,7 @@ pub const Jumplist = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.jumps_buffer, .steps = true, .locations = true };
pub fn run(c: Ctx) void {
- panes.Output.openJumps(c.p, c.id) catch |err| c.p.reportError(c.id, "jumplist", err);
+ panes.Output.openJumps(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "jumplist", err);
}
};