diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 23:08:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 23:20:24 -0300 |
| commit | 5c941c2278a4e099f3cd4bae1b29a783f88a95b0 (patch) | |
| tree | dabbe402d1319c53d2ba4ca05d6bef227b3e4704 /core/Output.zig | |
| parent | c9114545cce7f7598a4929d8254de1d3baccde84 (diff) | |
| download | pardes-5c941c2278a4e099f3cd4bae1b29a783f88a95b0.tar.gz pardes-5c941c2278a4e099f3cd4bae1b29a783f88a95b0.zip | |
Messages, Pick, Output: where jumps walk, SPC e lands an error's places as a list in the pane's walk through D's picker, and SPC h m is a picker over the history in the pane's tag (walk UI G item 2c, SPEC §10.4, §5.1's messages source), C's stopgaps replaced: SPC e (Messages.act) made a +Search under the pane and walked it with the Look walk; now, when Pick.asked (jumps walk, not a 9P script), it opens Pick's `list` with the places as rows, its word `✗ <cause>` (cut at a character's start to the word's 24 bytes), and lands its first row at once as the prototype's actOnMessage does (openPicker then accept): the pane steps (or its reader, the pane being held), the list word goes into its trail before the place, n and N walk the places through Pick.walkList; the history (Messages.history, from SPC e with nothing to act on and from the Messages word, SPC h m) is Pick's new source `messages`, its rows Output.messagesText (openMessages' text, split out), the newest first, a place indented under its error; Enter on a message row gives the keyboard to its cause's pane while it is open, on a place row Looks the place; C-q keeps it as the +Messages (Pick.keep); the source is not offered among the picker's other sources (its second row), as `list` is not; where jumps open panes, and for a 9P script, both are as C made them; the Message and Messages docs say so (builtins-{tui,gui}.json regenerated); TEST FIRST: Messages.zig 'where jumps walk, SPC e lands an error's places as a list in the pane's walk, n walking them; SPC h m is a picker over the history…' (no pane made, the caret on the first place and then the second, the word `✗ @p9 zig build 1/2` then `2/2` in the tag, the history's rows newest first, Enter on a message, C-q the +Messages); C's own SPC e test keeps the +Search way (jumps open panes there); GOLDENS: builtins (SPC h m's doc two rows longer: the rows under it, Tutor's among them, two lower; the +Look's line 237 for 236; tty_boot.zig's click on Tutor's row 32 for 30) and leader (the same doc rows in help-group), nothing else; tui core-test 1035/1204 (169 skipped), process-test 0 of 146 failed after those two updates (2 before them: those two)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/Output.zig')
| -rw-r--r-- | core/Output.zig | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/core/Output.zig b/core/Output.zig index 32a00863..fe1543fe 100644 --- a/core/Output.zig +++ b/core/Output.zig @@ -986,26 +986,31 @@ pub fn openConfig(p: *Pardes, id: usize) !void { } /// The messages' history (the log ring), the newest first, each with its -/// kind's glyph, a live error's places under it (SPC h m). -pub fn openMessages(p: *Pardes, id: usize) !void { - var out: std.Io.Writer.Allocating = .init(p.gpa); - errdefer out.deinit(); +/// kind's glyph, a live error's places under it: the +Messages' text and +/// the Messages picker's rows (SPC h m). +pub fn messagesText(p: *Pardes, w: *std.Io.Writer) !void { var i: usize = p.messages.len; while (i > 0) { i -= 1; const m = p.messages.at(i).?; - try out.writer.print("{s} ", .{m.kind.glyph()}); - if (m.serial != 0) try out.writer.print("{d}: ", .{m.serial}); - try out.writer.writeAll(m.slice()); - if (m.repeats > 1) try out.writer.print(" (x{d})", .{m.repeats}); - try out.writer.writeByte('\n'); + try w.print("{s} ", .{m.kind.glyph()}); + if (m.serial != 0) try w.print("{d}: ", .{m.serial}); + try w.writeAll(m.slice()); + if (m.repeats > 1) try w.print(" (x{d})", .{m.repeats}); + try w.writeByte('\n'); for (p.messages.live[0..p.messages.live_len]) |*s| { if (s.kind != .@"error" or s.places_len == 0 or !std.mem.eql(u8, pardes.Messages.Message.body(s.text.slice()), pardes.Messages.Message.body(m.slice()))) continue; - for (s.places[0..s.places_len]) |*place| try out.writer.print(" {s}:{d}:{d} {s}\n", .{ place.path.slice(), place.line, place.col, place.text.slice() }); + for (s.places[0..s.places_len]) |*place| try w.print(" {s}:{d}:{d} {s}\n", .{ place.path.slice(), place.line, place.col, place.text.slice() }); break; } } - if (p.messages.len == 0) try out.writer.writeAll("nothing has been said yet\n"); + if (p.messages.len == 0) try w.writeAll("nothing has been said yet\n"); +} + +pub fn openMessages(p: *Pardes, id: usize) !void { + var out: std.Io.Writer.Allocating = .init(p.gpa); + errdefer out.deinit(); + try messagesText(p, &out.writer); const content = try out.toOwnedSlice(); return openRead(p, id, .{ .cmd = .Messages }, "", content); } |
