diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-25 02:07:23 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-25 09:42:07 -0300 |
| commit | 6f48508aa08396bcf9dd4da2cab1d221bcc53f78 (patch) | |
| tree | 83daec3db5ac27ea3172651df2b3e9cb62eddb4a /src/output_pane.zig | |
| parent | 28c70cabb6ceb7e5fecfd74f6984f5a995269f01 (diff) | |
| download | pardes-6f48508aa08396bcf9dd4da2cab1d221bcc53f78.tar.gz pardes-6f48508aa08396bcf9dd4da2cab1d221bcc53f78.zip | |
acmefs: pardes --fs serves acme's control filesystem over raw Linux FUSE
Diffstat (limited to 'src/output_pane.zig')
| -rw-r--r-- | src/output_pane.zig | 11 |
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 }; |
