summaryrefslogtreecommitdiff
path: root/src/output_pane.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/output_pane.zig')
-rw-r--r--src/output_pane.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/output_pane.zig b/src/output_pane.zig
index a7763bd3..9021e479 100644
--- a/src/output_pane.zig
+++ b/src/output_pane.zig
@@ -48,6 +48,11 @@ pub const Origin = union(enum) {
query: lsp.Kind,
/// the bare `/` — the pane's own text, searched in core
search,
+ /// acme's `+Errors`: whatever a script wrote to a pane's `errors` file or
+ /// to the top-level `cons`. Not a command at all — the third vocabulary
+ /// is "somebody else's output", and it has no word to click because the
+ /// writer is a process, not a keystroke.
+ errors,
};
/// The exact command identity. A search prompt is bounded by the same one-line
@@ -92,6 +97,10 @@ pub fn traits(o: Origin) Traits {
return switch (o) {
// rows are `location text`, so n/N walk them
.search => .{ .name = config.search_buffer, .steps = true },
+ // A transcript, not a list: rows are whatever a program printed, so
+ // n/N walks its words like any prose buffer, and there is nothing to
+ // Save — acme's +Errors is not a file either.
+ .errors => .{ .name = config.errors_buffer, .doc = true },
.cmd => |b| builtins.registry.outputTraits(b) orelse unreachable,
.query => |k| switch (k) {
.hover => .{ .name = config.hover_buffer },
@@ -158,6 +167,7 @@ pub fn word(o: Origin) []const u8 {
.cmd => |b| @tagName(b),
.query => |k| @tagName(k),
.search => "/",
+ .errors => config.errors_buffer,
};
}
@@ -166,6 +176,7 @@ pub fn word(o: Origin) []const u8 {
pub fn fromWord(w: []const u8) ?Origin {
if (w.len == 0) return null;
if (std.mem.eql(u8, w, "/")) return .search;
+ if (std.mem.eql(u8, w, config.errors_buffer)) return .errors;
if (std.meta.stringToEnum(Builtin, w)) |b|
if (builtins.registry.outputTraits(b) != null) return .{ .cmd = b };
if (std.meta.stringToEnum(lsp.Kind, w)) |k| return .{ .query = k };