summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Output.zig b/src/Output.zig
index c76e31b1..1bf1b453 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -571,13 +571,18 @@ pub fn openJumps(p: *Pardes, id: usize) !void {
}
/// The state file's dumps as rows (Db.listDumps: label, date, size, pane
-/// count, the panes' names), the newest first; a look at a row is a
-/// Restore of its label (look.zig). Asked of the authority: the state file
-/// is its host's.
+/// count, the panes' names), the newest first, each behind the `Restore`
+/// that brings it back: an exec of a row's Restore takes the label beside
+/// it (exec.operandAt), and a look at the row is the same (look.zig).
+/// Asked of the authority: the state file is its host's.
pub fn openHistory(p: *Pardes, id: usize) !void {
const text = pardes.tape.authority(dumpsText, .{p}) orelse return error.NoStateFile;
if (text.len == 0) return error.NoDumps;
- try refillOrOpen(p, id, .{ .cmd = .History }, try p.gpa.dupe(u8, text));
+ var out: std.Io.Writer.Allocating = .init(p.gpa);
+ errdefer out.deinit();
+ var rows = std.mem.splitScalar(u8, std.mem.trimEnd(u8, text, "\n"), '\n');
+ while (rows.next()) |row| try out.writer.print("Restore {s}\n", .{row});
+ try refillOrOpen(p, id, .{ .cmd = .History }, try out.toOwnedSlice());
}
/// Db.listDumps's text, the step's (scratch); null for no state file.