summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 02:40:12 -0300
committerGabriel Schneider <[email protected]>2026-10-01 02:40:12 -0300
commit3bddd662eac9a7829174f3c54b498bda84df1961 (patch)
tree4986bfc96c0582dceb928701a1b08489168b1ee9 /src/dump.zig
parent6c0e9c5a6b6d4b0aa77f084fdac5eb4f6d1f482b (diff)
downloadpardes-3bddd662eac9a7829174f3c54b498bda84df1961.tar.gz
pardes-3bddd662eac9a7829174f3c54b498bda84df1961.zip
A Restore, or -l, of a dump naming a ThemeFile asks the host to load it again, as a /ctl write of it does
The dump's ThemeFile line went to the settings table, which has no such setting and never asks the host to read a file, so a restored session came back in the default theme. The restore now makes the request a /ctl ThemeFile makes, and the host loads the file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dump.zig b/src/dump.zig
index 983d5894..f8b99ef4 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -811,6 +811,12 @@ fn changedSettings(p: *Pardes, arena: std.mem.Allocator) ![]const []const u8 {
fn applySettings(p: *Pardes, lines: []const []const u8) void {
for (lines) |line| {
const sp = std.mem.indexOfScalar(u8, line, ' ');
+ // A ThemeFile is a request the host answers by reading the file, as
+ // a /ctl write of it is: asked again here, not dropped.
+ if (std.mem.eql(u8, line[0 .. sp orelse line.len], "ThemeFile")) {
+ if (sp) |s| colors.requestThemeFile(p, 0, line[s + 1 ..]);
+ continue;
+ }
const setting = config.Runtime.find(line[0 .. sp orelse line.len]) orelse continue;
_ = p.settings.apply(setting, if (sp) |s| line[s + 1 ..] else null);
}