summaryrefslogtreecommitdiff
path: root/core/dump.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/dump.zig')
-rw-r--r--core/dump.zig10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/dump.zig b/core/dump.zig
index 2dde9c8c..69eda35e 100644
--- a/core/dump.zig
+++ b/core/dump.zig
@@ -422,10 +422,8 @@ fn loadKnowing(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes:
const was = try l.get(OnDisk);
if (on_disk) |out| out.* = was;
const theme = try l.get([]const u8);
- // This build's place for that theme; one it has not, its first.
- p.settings.theme = for (colors.themes, 0..) |t, i| {
- if (std.mem.eql(u8, t.name, theme)) break i;
- } else if (p.settings.theme < colors.themes.len) p.settings.theme else 0;
+ // This build's place for that theme, a retired one's successor's.
+ p.settings.theme = colors.restoredIndex(theme, p.settings.theme);
// A mount this process was started with stands; one of the same name
// to elsewhere is refused, never silently put over it.
for (mounts) |m| {
@@ -515,9 +513,7 @@ fn loadImage(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: ?*
if (on_disk) |out| out.* = was;
const theme: []const u8 = if (try walk.Get.member(root, "theme")) |c| try l.get([]const u8, c) else "";
defer gpa.free(theme);
- p.settings.theme = for (colors.themes, 0..) |t, i| {
- if (std.mem.eql(u8, t.name, theme)) break i;
- } else if (p.settings.theme < colors.themes.len) p.settings.theme else 0;
+ p.settings.theme = colors.restoredIndex(theme, p.settings.theme);
for (mounts) |m| {
const existing = for (p.fs.mounts.items) |e| {
if (std.mem.eql(u8, e.name, m.name)) break e;