diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-09 23:15:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-09 23:15:53 -0300 |
| commit | 0b4cfd4b416d03ef64ccd908dfee810c6a498569 (patch) | |
| tree | 83da4851e30b4dd0e788b66f0024d5b55eaee421 /src/Output.zig | |
| parent | 7e6fc8c9f62bc3dc08e24856cc647fa0adefb32c (diff) | |
| download | pardes-0b4cfd4b416d03ef64ccd908dfee810c6a498569.tar.gz pardes-0b4cfd4b416d03ef64ccd908dfee810c6a498569.zip | |
a session's end leaves a slim dump and History lists them, the tags gain Follow, History and the window's Fonts: every way out (Exit, the last pane's Del, the host's quit) runs Pardes.endSession, which puts a dump of the session in the state file under the usual label before quitting, slim by the dump's own means (dumpJoin's slim_terminals, and Store's slim-file swap now a Slim struct: no undo, a clean file's text read from its file again by revivePane, a terminal a size for a new shell), none for a session of shells alone; the dump's image carries the panes' names, which /dumps rows end with; the History builtin (SPC f h) lists the state file's dumps in a +History pane and a look at a row is a Restore of its label; the default tags: Follow after Collapse on text panes, History before Debug on the workspace row, Fonts after Themes in a window's view alone (tagline.topbarDefault picks the row per view; both rows are known defaults to the docs and tutor tests); the tty goldens re-recorded (the new words; a narrow pane's tag wraps to a second row, so its body rows shift), builtins JSON regenerated
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Output.zig')
| -rw-r--r-- | src/Output.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Output.zig b/src/Output.zig index 0161878e..a38245c7 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -570,6 +570,23 @@ pub fn openJumps(p: *Pardes, id: usize) !void { try refillOrOpen(p, id, .{ .cmd = .Jumplist }, try out.toOwnedSlice()); } +/// 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. +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)); +} + +/// Db.listDumps's text, the step's (scratch); null for no state file. +fn dumpsText(p: *Pardes) ?[]const u8 { + var out: std.Io.Writer.Allocating = .init(p.scratch.allocator()); + p.db.listDumps(p, &out.writer) catch return null; + return out.written(); +} + /// The recent list as rows: `<path>:<line>:<col> open|closed`, most recent /// first; a look at a row opens the file there, as a +Jumps row does. pub fn recentText(p: *Pardes, w: *std.Io.Writer, look_rows: bool) !void { |
